aglinxinyuan opened a new issue, #5549:
URL: https://github.com/apache/texera/issues/5549

   ## Background
   
   Three concrete `DeployStrategy` implementations in 
`engine/architecture/deploysemantics/deploystrategy` currently lack a dedicated 
unit-spec:
   
   | Source class | Purpose |
   | --- | --- |
   | `OneOnEach` | Returns each available `Address` exactly once; throws on 
exhaustion |
   | `RoundRobinDeployment` | Returns addresses cyclically (wrap-around) |
   | `RandomDeployment` | Returns a random address; throws on empty |
   
   All three implement the `DeployStrategy` trait (`initialize(available: 
Array[Address]): Unit` + `next(): Address`) and are used by 
`ExecutorDeployment` when picking remote worker hosts.
   
   ## Behavior to pin
   
   | Surface | Contract |
   | --- | --- |
   | `OneOnEach.next` (after `initialize` with N addresses) | yields each of 
the N addresses in order, exactly once |
   | `OneOnEach.next` (after exhaustion) | throws `NoSuchElementException` |
   | `OneOnEach.initialize` (second call) | resets the cursor — `next` starts 
over from index 0 |
   | `RoundRobinDeployment.next` | wraps around after the last address (cyclic) 
|
   | `RoundRobinDeployment.next` (single-element array) | repeatedly returns 
the same address |
   | `RoundRobinDeployment.next` (empty array) | throws 
`NoSuchElementException` |
   | `RandomDeployment.next` | returns an `Address` that is one of the 
initialized values |
   | `RandomDeployment.next` (empty array) | throws `NoSuchElementException` |
   
   ## Scope
   
   - New spec files (one per source class per the spec-filename convention):
     - `OneOnEachSpec.scala`
     - `RoundRobinDeploymentSpec.scala`
     - `RandomDeploymentSpec.scala`
   - No production-code changes.
   - `DeployStrategy` is a trait; its contract is exercised through the three 
concrete specs.


-- 
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]

Reply via email to