Repository navigation
[Improve][API] Use HashUtils.bucketIndex in MultiTableSinkWriter routing - #12290
Conversation
apache#11721 fixed the negative queue index by masking the sign bit inline, because the shared helper did not exist at that point. HashUtils.bucketIndex landed separately in apache#11987, a week after apache#11721's branch point, so the two could not be combined at the time. Both spellings are the same function: bucketIndex is exactly (hash & Integer.MAX_VALUE) % bucketCount. This replaces the inline expression with the call, which removes the last copy of the idiom in the codebase and puts the Integer.MIN_VALUE reasoning in one documented place instead of a comment at the call site. The helper rejects a non-positive bucketCount with IllegalArgumentException where the inline form would divide by zero. That path is unreachable here, since an empty queue list would already fail in the random-routing branch on Random.nextInt(0), and an explicit message is the better outcome either way. The existing routing tests are unchanged and still pin the exact target queue for an Integer.MIN_VALUE primary key hash. Closes apache#11976
DanielLeens
left a comment
There was a problem hiding this comment.
What Problem Does This PR Solve?
This is a pure internal refactor, not a bug fix. MultiTableSinkWriter.write(SeaTunnelRow) routes a row to a queue by (primaryKeyValue.hashCode() & Integer.MAX_VALUE) % blockingQueues.size(). That exact expression, and the reasoning behind it (why masking the sign bit and not Math.abs, because Math.abs(Integer.MIN_VALUE) is still negative), was written inline as part of #11721's fix for the Integer.MIN_VALUE routing bug. Since then, HashUtils.bucketIndex(int, int) was added in #11987 as the shared home for exactly this idiom, used by many split enumerators. This PR swaps the inline expression for the shared helper, closing the tracking issue #11976 that was left open for this migration until #11721 landed.
Before/after example: for blockingQueues.size() == 3 and a primary key whose hashCode() is Integer.MIN_VALUE:
- Before:
index = (Integer.MIN_VALUE & Integer.MAX_VALUE) % 3computed inline ->0. - After:
index = HashUtils.bucketIndex(Integer.MIN_VALUE, 3)->(Integer.MIN_VALUE & Integer.MAX_VALUE) % 3->0.
Same result for every input; nothing a job author or operator observes changes.
1. Code Change Review
1.1 Core Logic Analysis
Change is confined to seatunnel-api/.../MultiTableSinkWriter.java, write(SeaTunnelRow) (line ~617-621 in the PR head):
- index = (object.hashCode() & Integer.MAX_VALUE) % blockingQueues.size();
+ index = HashUtils.bucketIndex(object.hashCode(), blockingQueues.size());I read HashUtils.bucketIndex(int, int) at head (seatunnel-common/.../utils/HashUtils.java):
public static int bucketIndex(int hash, int bucketCount) {
checkBucketCount(bucketCount);
return (hash & Integer.MAX_VALUE) % bucketCount;
}This is byte-for-byte the same computation as the inline expression it replaces, just with an added bucketCount <= 0 guard in front. So the routing function is provably identical for every int input, including Integer.MIN_VALUE — no need to take the PR description's word for it.
Runtime flow: write() is on the normal per-row hot path (not a boundary/recovery path) for any multi-table sink with a primary key present and non-null on the row — this is the common case for CDC/ordered-delivery sinks, so this is squarely a mainline-path change, which is exactly why it deserves the scrutiny it's getting.
The javadoc on write(SeaTunnelRow) is updated to point at HashUtils#bucketIndex instead of re-deriving the masking rationale at the call site — good, it keeps one source of truth instead of two copies of the same reasoning drifting apart.
One correctness nuance the PR calls out and I verified independently: object.hashCode() returns int, so this resolves to the bucketIndex(int, int) overload, not bucketIndex(long, int). The two overloads are documented as distinct mappings (not a widening), so this is the right overload and there's no accidental semantic change from an overload mismatch.
1.2 Compatibility Impact
Fully compatible. No config, API, protocol, or serialization surface is touched. Routing output is identical for every hash/queue-count combination, so:
- No redistribution of in-flight or replayed rows across writer queues on upgrade.
- No checkpoint/state compatibility concern — this method doesn't participate in checkpoint state, it only routes a row to a queue at write time.
The one behavioral delta, and it's a genuine (not overlooked) one: if blockingQueues.size() were ever 0, the old code would throw ArithmeticException (% 0 on int), the new code throws IllegalArgumentException from checkBucketCount. I checked whether this path is actually reachable: blockingQueues is populated once in the constructor from queueSize, and the same write() method's random-routing branch (line ~604, unchanged) already calls random.nextInt(blockingQueues.size()), which itself throws for a non-positive bound. So a queueSize == 0 writer is already broken well before this change; this PR doesn't introduce a new failure mode, it just changes the exception type at one of several call sites that would already fail. Not user-facing today, since queueSize is always derived from the number of physical sinks/parallelism (never zero in the constructor call sites I checked).
1.3 Performance / Side-Effect Analysis
None. HashUtils.bucketIndex is a two-operation static call (a comparison + branch on bucketCount, then the same mask-and-modulo). No allocation, no locking, no I/O. Negligible/no measurable overhead versus the inline expression, called once per row on the hot path.
1.4 Error Handling and Logging
No behavior change in the reachable path (see 1.2). No new logging, no swallowed exceptions.
2. Code Quality Assessment
2.1 Coding Standards
New import (HashUtils) is used, no dead import left behind. No new public method or field is introduced by this PR, so there's nothing new here requiring its own Javadoc; the existing write(SeaTunnelRow) doc is correctly updated instead of just deleted. Diff is minimal and matches the stated intent — nothing extraneous is touched in this class-heavy file.
2.2 Test Coverage and Test Stability
The diff does not touch MultiTableSinkWriterTest.java (0 test files changed), which is fine here because the pre-existing tests from #11721 already pin the exact routing outcome rather than merely asserting "does not throw":
testMinValuePrimaryKeyHashRoutesToValidQueuecomputesexpectedIndex = (Integer.MIN_VALUE & Integer.MAX_VALUE) % replicaNumand asserts writes landed in that exact queue and nowhere else.testOrdinaryNegativeHashRoutesToMaskedIndexdoes the same for an ordinary negative hash (-5), explicitly asserting the masked index differs from whereMath.absrouting would have sent it.
Since both asserted expectedIndex values are computed with the identical (hash & Integer.MAX_VALUE) % bucketCount formula that HashUtils.bucketIndex implements, these tests exercise the new call path and would fail on any routing regression, not just a crash. This is a case where "no test changes" is the correct outcome, not a coverage gap — I verified this by reading the test file at the PR head rather than taking the PR description's claim at face value.
No UT/E2E code is touched by this diff, so the mandatory flaky-test analysis doesn't apply; nothing here introduces timing, ordering, or environment dependence. Stability rating: Stable.
2.3 Documentation Updates
N/A — no user-facing config, CLI, or connector doc references this internal routing expression. docs/en / docs/zh don't need changes.
3. Architectural Soundness
3.1 Elegance of the Solution
This is the precise fix, not a workaround: it removes the last inline copy of an idiom that already has a shared, documented, tested home, without changing behavior. Matches the pattern already applied to ~15 other call sites (Kafka, ClickHouse, JDBC, Fluss, HBase, MongoDB, Iceberg, Paimon, Pulsar, RocketMQ, Bigtable, AzureCosmosDB, etc. — confirmed via HashUtils.bucketIndex usage search at head).
3.2 Maintainability
Improves it: one place (HashUtils) now carries the "why masking, not Math.abs" reasoning and the "don't confuse the int/long overloads" warning, instead of a comment that could drift from the shared helper's own doc over time.
3.3 Extensibility
No impact — this is a leaf call site, not an abstraction boundary.
3.4 Historical-Version Compatibility
No concern: routing is byte-for-byte identical for every input (proven above from the helper's actual implementation, not inferred from the PR description), so upgrading a running job across this change redistributes nothing.
4. Issue Summary
| # | Issue | Location | Severity |
|---|---|---|---|
| 1 | PR description misattributes part of the "other call sites" migration history to #11937, which is actually an unrelated Zeta SQL ROUND/CEIL numeric-type fix ("Handle TINYINT and SMALLINT in Zeta SQL numeric functions"). All other call-site migrations I could find (Kafka, ClickHouse, JDBC, Fluss, HBase, MongoDB, Iceberg, Paimon, Pulsar, RocketMQ, Bigtable) were introduced by #11987 itself, and AzureCosmosDB by #12049 — I could not find any HashUtils-related change in #11937. This doesn't affect the code, only the PR's narrative/traceability. |
PR description | Low |
No other issues found — the diff is a byte-for-byte behavior-preserving refactor and I independently verified the equivalence from the actual HashUtils source rather than accepting the PR's claim.
5. Merge Recommendation
Conclusion: Ready to merge
- Blockers — none.
- Recommended fixes — non-blocking:
- Correct or drop the
#11937reference in the PR description (issue #1 above) before merge, purely for accurate history; it has no effect on the code itself.
- Correct or drop the
Overall assessment: This is exactly the kind of change that should be simple to review and is: single file, single expression swapped for an equivalent library call, existing tests already pin the exact numeric outcome so a routing regression would fail loudly, and the routing function was verified equivalent by reading the actual HashUtils implementation rather than trusting the PR's own equivalence claim. blockingQueues/queue-count reachability for the one behavioral delta (exception type on an already-unreachable bucketCount == 0) was traced through the constructor and the adjacent random-routing branch, not assumed.
CI: As of this review, the apache-side "Build" check and the fork's own Build workflow run are both still in progress/queued (fork run 34740599956 on SEPURI-SAI-KRISHNA/seatunnel, branch migrate-multitablesink-bucketindex, was still queued/no conclusion at review time) — no result to diagnose yet. Given the scope of this change (one file, no new dependencies, seatunnel-api already depends on seatunnel-common for other utils), I'd expect a clean pass; please let it finish and it should be squash-mergeable once green.
|
Thanks for the review, and for catching the history error. You are right and I have corrected the description. #11937 is "[Fix][Transform-V2] Handle TINYINT and SMALLINT in Zeta SQL numeric functions" and has nothing to do with On your reachability trace for On CI: the fork run is still going, and I would rather let it finish than rerun into what looks like a bad window. The failures so far are not specific to this change. They overlap almost exactly with the ones on my other open PR #12182, which is a test-only change in Where I have read the logs, the causes are environmental rather than assertions. |
|
Thanks for tightening up the description and for double-checking the reachability trace independently rather than just taking my word for it — appreciated. One thing worth correcting before you spend more reruns waiting on it: the Doesn't change my approval on this one — still a clean, self-contained one-line swap in |
|
Agreed, and that matches what I found independently before reading this. Syncing now. Two refinements from the attempt 2 logs.
On the registry state, what is observable from outside is that anonymous pulls are denied, rather than that the repository is definitely gone. An anonymous manifest request for One thing to expect after the sync: |
DanielLeens
left a comment
There was a problem hiding this comment.
What Problem Does This PR Solve?
Sorry for missing this in the last review — that's on me. I re-reviewed the latest head and want to flag that this is actually a non-event from a code perspective: the only new commit since my prior approval is a merge from upstream/dev (b319d412) to pick up unrelated dev fixes for the CI environment issues we discussed on this thread (notably the minio/minio Docker Hub removal fix, #12287). It carries no new business-logic change.
This PR itself replaces the inline (primaryKeyValue.hashCode() & Integer.MAX_VALUE) % blockingQueues.size() expression in MultiTableSinkWriter.write(SeaTunnelRow) with the equivalent shared helper HashUtils.bucketIndex(int, int), closing out the migration tracked by #11976 now that #11721 (which introduced the inline form before the helper existed) has landed on dev.
1. Code Change Review
1.1 Core Logic Analysis
I diffed the current PR head against origin/dev with git diff origin/dev...HEAD --stat and confirmed the merge commit did not change the reviewable surface at all:
.../api/sink/multitablesink/MultiTableSinkWriter.java | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
This is byte-identical in scope to what I approved before the sync. The change itself, re-verified against the current head:
- index = (object.hashCode() & Integer.MAX_VALUE) % blockingQueues.size();
+ index = HashUtils.bucketIndex(object.hashCode(), blockingQueues.size());I re-read HashUtils.bucketIndex(int, int) at the current head (seatunnel-common/.../utils/HashUtils.java:47-50):
public static int bucketIndex(int hash, int bucketCount) {
checkBucketCount(bucketCount);
return (hash & Integer.MAX_VALUE) % bucketCount;
}Same conclusion as last time, re-verified rather than assumed: this is byte-for-byte the same computation as the inline expression, so routing is unchanged for every int input including Integer.MIN_VALUE. write() sits on the normal per-row hot path for any multi-table sink with a non-null primary key value — a mainline-path change, not a boundary path, which is why it earned this level of scrutiny both times.
Key findings on re-review:
- The diff content is unchanged from my prior approval; only a merge-from-dev commit was added.
HashUtils.bucketIndex(int, int)implementation is unchanged at the current head — the equivalence proof still holds.- No new call sites, no new tests, no new files were introduced by the sync commit that touch this PR's subject matter.
- The thread discussion (SEPURI-SAI-KRISHNA and I) correctly diagnosed the prior CI failures (
minio/minio404 from Docker Hub, a stale Maven artifact resolution blip, andS3FileConnectDryRunITfrom #12242 still pointing at Docker Hub) as environmental/upstream, not caused by this one-lineseatunnel-apichange — the sync is the correct remedy for the ones already fixed ondev(#12287).
1.2 Compatibility Impact
Fully compatible — unchanged from my prior review. No config, API, protocol, or serialized/state format is touched. Routing output is identical for every hash/queue-count combination, so there is no restore-compatibility risk: a job upgraded across this change routes every primary key to the exact same physical writer queue it would have before, so in-flight/replayed rows after a checkpoint restore are not redistributed. The one behavioral delta (an unreachable bucketCount == 0 path now throws IllegalArgumentException instead of ArithmeticException) remains unreachable in practice, since the adjacent random-routing branch already calls random.nextInt(blockingQueues.size()) first and would fail before this line for an empty queue list.
1.3 Performance / Side-Effect Analysis
None, unchanged from prior review. HashUtils.bucketIndex is a guard check plus the same mask-and-modulo, no allocation, no locking, no I/O, called once per row.
1.4 Error Handling and Logging
No behavior change on the reachable path. No new logging, nothing swallowed.
2. Code Quality Assessment
2.1 Coding Standards
Unchanged from prior review: clean single-purpose diff, javadoc correctly updated to reference the helper instead of re-deriving the masking rationale at the call site, no dead imports.
2.2 Test Coverage and Test Stability
Unchanged from prior review, re-verified at the current head: MultiTableSinkWriterTest still pins the exact expected queue index for an Integer.MIN_VALUE-hashing primary key and for an ordinary negative hash, using the identical (hash & Integer.MAX_VALUE) % bucketCount formula the helper implements. These assert the concrete index, not just "no exception," so a routing regression introduced by this swap would fail them. No test files are touched by this PR (correctly — nothing about the test needs to change), and the sync commit did not modify or weaken any test. Stability rating: Stable.
2.3 Documentation Updates
N/A, unchanged — no user-facing docs reference this internal routing expression.
3. Architectural Soundness
3.1 Elegance of the Solution (Precise fix)
Unchanged assessment: this is the precise, minimal fix — removing the last inline copy of an idiom that already has a shared, tested, documented home, with proven behavior equivalence.
3.2 Maintainability
Improves it — one documented place now carries the masking rationale and the int/long-overload warning.
3.3 Extensibility
No impact — leaf call site.
3.4 Historical-Version Compatibility
No concern — proven byte-for-byte identical routing output, so no restore-compatibility break across the upgrade boundary. This was the specific angle I was asked to scrutinize hardest on re-review, and the merge-from-dev commit does not change that conclusion.
4. Issue Summary
| # | Issue | Location | Severity |
|---|---|---|---|
| 1 | (Already resolved) PR description previously misattributed part of the call-site migration history to #11937; this was corrected in the description after my first review. No remaining action. | PR description | Low |
No new issues found on this re-review. No blockers.
5. Merge Recommendation
Conclusion: Ready to merge
- Blockers — none.
- Recommended fixes — none outstanding; the one non-blocking documentation nit from my first pass was already fixed by the author.
Overall assessment: Re-reviewed the entire current diff against origin/dev, not just the incremental commit, per the process for a NEED_REREVIEW pass. The only change since my prior approval is a merge from dev to absorb the minio/minio mirror fix for CI, and it introduces zero business-logic delta — the routing change remains a byte-for-byte equivalent swap to a shared helper, fully restore-compatible, with tests that pin the exact numeric outcome. Thanks again to SEPURI-SAI-KRISHNA for the careful, evidence-based back-and-forth on the CI triage in this thread — that made this re-check fast and confident rather than a guess.
CI: At review time, the fork's Build run for the new head (b319d412, run 34799734299) is still queued/in progress following the just-completed sync — no result to diagnose yet. Given the change is unchanged from my already-approved diff and the sync specifically targets the previously-diagnosed environmental failures, I'd expect a clean pass once it completes; no need to hold this up further on my end.
|
CI is down to one job after the sync, and it is not reachable from this diff. The sync cleared the MinIO family for good, as expected once #12302 landed. Failed legs went from seven before the sync, to four, to two legs of a single job now: That job failed a different test each time. Attempt 1 was It is also not specific to this PR. #12403 has For completeness on the diff itself: @nzw921rx this has had @DanielLeens's approval since 09-14 and is green everywhere except that one job, if you are happy to take it. |
Please wait dev fixed, then rebase? |
|
If you're willing, could you help fix it?💌 |
|
Thanks for the approval. Happy to rebase whenever you want, though it would be a no-op for this job today. #12290 is exactly 3 commits behind dev and all three are mine: #12349 and #12392 (RocketMQ) and #12410 (MQTT). None touch I also need to correct something I wrote above. I said the differing failures looked like runner load. That was wrong, and I found it by pulling the two job logs in full instead of reading the summaries again. Both legs are real, and both are already filed. JDK 8, Not a timeout. FAILED is terminal, so the Awaitility condition could never have become true afterwards. This is #12353, which @tomatotomata reproduced on unmodified dev. What the log does establish is the path: the member-removed handler assigned FAILED to the SplitEnumerator vertex, and What it does not establish is the state of that vertex at the moment the member was removed, because vertex transitions are not logged at this level. That matters for #12311, which redirects a vertex only when it was already CANCELING; traced through JDK 11, Fails at line 193, the first-checkpoint gate, not the sustained-window assertion. The Dev matches the starvation preconditions #12313 describes: the conf sets So both failures have open fixes already and I am not going to add another PR in the same area. On helping, what I have that those PRs do not is an independent reproduction of both from a change that touches one line of For this PR in the meantime, the diff is |
|
Following up on the #12377 note above: I read that thread properly and @SEZ9 already raised exactly that point in a changes-requested review on 09-18, including the That also sharpens the answer to your question. Both engine failures already have fixes written. #12311 covers the cancellation one, and the #12353 thread has settled on it as the implementation rather than a separate PR. #12313 or #12316 covers the backpressure one. None of them is waiting on analysis. #12311 and #12313 have no approvals, and #12377 has had blocking review comments unanswered since 09-18. Review attention is what would move them, so that is where I would put any help you want from me. |
|
Thanks for digging into the full logs and for the correction — that is a much clearer picture than the runner-load theory, and I agree the two On your point about review attention: understood, that is where I can actually help. I will look at #12311 for the cancellation path first, since you say #12353 has settled on it as the implementation. One clarification I need from you: you wrote "#12313 or #12316 covers the backpressure one" — which of the two is the one to review? If both exist, tell me which is the intended fix so I do not split attention across them. For this PR itself: since the 3 commits behind dev are yours and none touch |
|
Thanks, and to answer directly: #12316 is the one to review for the backpressure failure. #12313 is worth reading first as context, but it is not the fix. They are not two competing implementations, they are the same defect at two levels, both by @DanielLeens. #12316 is the engine-side root cause. #12313 changes only the test: the config on dev is One correction to my own earlier framing while I am here. I described the A small note if you review #12313 as well: the comment it adds says the reader's sleep gives barrier injection a contention-free window "once per second". With 4000 rows per split and the sink at On this PR: agreed, leave it parked and rebase once the engine fixes land, then rerun |
|
Thanks both for chasing this down so thoroughly — that's a lot more useful than another CI rerun would have been. Confirming from my side: the head is still the same commit I approved on 09-14 ( On My approval stands. Agreed with the plan to leave this parked, rebase once #12311 and #12316 land, and get one clean |
|
Thanks @SEPURI-SAI-KRISHNA, that clears it up. Agreed that there is nothing further to add on the On the backpressure side, the split you laid out is the one I'll go with: #12316 is the fix to review (the For this PR: the head is still
I'll pick up the review of #12316 from here. |
|
Thanks @SEZ9 — that's a clean summary and matches what I read as well. Head here is still Agreed on the plan: leave this parked until #12311 and #12316 land, then rebase once and get one clean |
|
Thanks @SEPURI-SAI-KRISHNA — one thing I didn't pick up in my earlier replies: the "once per second" wording in the javadoc on the test-only resize is my mistake. With 4000 rows per split and the sink at 500 rows per second, the contention-free window is once per 8 seconds, not once per second. The conclusion against the 15 second checkpoint interval still holds, but the stated margin is wrong, so I'll correct that javadoc on my PR myself rather than leave it as is. Nothing else changes here: this PR stays parked at |
|
Thanks for flagging the javadoc correction on your side. Confirming from my end: head here is still The "once per second" vs "once per 8 seconds" margin correction is scoped to #12313's javadoc, not to anything in this PR, so it doesn't change my assessment here. My approval stands. Plan unchanged: leave #12290 parked at |
|
Refreshed this branch onto current The diff is untouched by the refresh: one file, Both failures on the old run are pre-existing, and both already have open issues.
Neither is a whole-suite failure. JDK 8 finished Where the backpressure test died matters. Its trace is Neither test can reach the changed code. Both fail on unmodified Since #12311 and #12313 are both open, a rerun here will likely land on one of them again rather than come back green, so I would rather not keep rerunning. @nzw921rx @davidzollo if you agree the reds are unrelated, this is ready from my side. If you would rather wait for #12311 and #12313 to land first, say so and I will park it. |
|
Correcting my previous comment. The rerun on
Run
- index = (object.hashCode() & Integer.MAX_VALUE) % blockingQueues.size();
+ index = HashUtils.bucketIndex(object.hashCode(), blockingQueues.size());
The failure itself is
I could not find an open issue for it. I am deliberately not filing one on a single observation, since one occurrence is an anecdote; if it shows up again I will sample the nightly runs properly and file it with evidence. So the position is unchanged in substance: this PR's diff is one file, @nzw921rx @davidzollo I would rather not keep rerunning and burning CI on this. If you are satisfied the above is unrelated, this is ready from my side; if you would prefer to wait for #12116 and the rest to clear, say so and I will park it until then. |
|
Thanks for the rebase and for the follow-up correction, @SEPURI-SAI-KRISHNA. On the diff side nothing changes for me: the refresh onto On run
Two concrete asks before I merge:
Nothing else outstanding from my side. |
|
Rerun done, @SEZ9, and it is green. No new commit, same head Attempt 2: 83 jobs successful, 11 skipped, 0 failed. The upstream The three legs you asked about:
On 94 seconds against 1,853. The failure was the fixture never coming up inside its three-minute window on a slow runner, not anything in the test or in this change. One occurrence with no recurrence, so I am not filing it, as agreed. If it shows up again I will sample the nightlies and open it with a proper sample rather than two anecdotes. Nothing else outstanding from my side. |
|
Thank you for your effort, he has indeed gone through a long CI cycle! |
Purpose of this pull request
Close #11976
#11721 fixed the negative queue index in
MultiTableSinkWriterby clearing the sign bit inline. That was deliberate rather than preferred:HashUtils.bucketIndexdid not exist at that branch point. It landed ondevthrough #11987 on 2026-09-01, a week after #11721's lastdevmerge, so adopting it there would have meant a fresh merge and a re-review of an already approved diff. #11976 was opened to track the migration and held open until #11721 merged, which it did on 2026-09-10.This is that migration:
The two are the same function for every input.
HashUtils.bucketIndex(int, int)is exactly(hash & Integer.MAX_VALUE) % bucketCount, so routing is unchanged for every key, includingInteger.MIN_VALUE. This removes the last remaining copy of the idiom and moves the reasoning into one documented place rather than a comment at the call site. #11987 migrated the other call sites when it introduced the helper, and #12049 did the AzureCosmosDB enumerator.The javadoc on
write(SeaTunnelRow)is updated to point at the helper instead of restating the expression.One deliberate behavioral difference:
bucketIndexrejects a non-positivebucketCountwithIllegalArgumentException, where the inline form would have thrownArithmeticExceptionon division by zero. That path is unreachable here, since an empty queue list would already fail earlier in the random-routing branch onRandom.nextInt(0), and the explicit message is the better outcome if it ever became reachable.Note also that
object.hashCode()is anint, so this binds to theintoverload.HashUtilsdocuments that theintandlongoverloads are distinct mappings rather than a widening, and a call site must not be switched between them. This one is not.Does this PR introduce any user-facing change?
No. Same routing for every input, no config or API surface touched.
How was this patch tested?
The existing routing tests in
MultiTableSinkWriterTestare unchanged and still pass, including the one that pins the exact target queue for a primary key whosehashCode()isInteger.MIN_VALUE. That test is what makes this a safe swap: it asserts the concrete index, not merely that the index is non-negative, so a change in mapping would fail it../mvnw -pl seatunnel-api spotless:checkpasses.