Ma77Ball opened a new pull request, #5029:
URL: https://github.com/apache/texera/pull/5029
### What changes were proposed in this PR?
`OneOnEach`, `RoundRobinDeployment`, and `RandomDeployment` each leaked a
different implementation-detail exception when `next()` was called on an empty
`available` array (`IndexOutOfBoundsException`, `ArithmeticException`,
and `IllegalArgumentException` respectively), so callers had no single
contract to handle. Each `next()` now guards `available.isEmpty` and throws
`NoSuchElementException("no available addresses")`, the standard Scala/Java
contract for "no element to return". For `OneOnEach`, the post-iteration
"exhausted" branch was also switched to `NoSuchElementException`, so both
empty-init and exhausted paths agree.
### Any related issues, documentation, or discussions?
Closes: #4732
### How was this PR tested?
- Updated the three pinning specs in `DeployStrategiesSpec` (previously
asserting the divergent exception types) to assert `NoSuchElementException`
for: `OneOnEach` empty-init, `OneOnEach` exhausted-after-iteration,
`OneOnEach` cursor-preserved-across-reinit, `RoundRobinDeployment` empty,
and `RandomDeployment` empty.
- Ran `sbt scalafmtAll` — no formatting changes to the modified files.
- Local `sbt testOnly` for the spec could not run due to a pre-existing
build.sbt load error (`AddMetaInfLicenseFiles not found`), unrelated to this
change; CI is expected to run the spec.
### Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.7 in compliance with ASF
--
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]