aglinxinyuan opened a new pull request, #7028:
URL: https://github.com/apache/texera/pull/7028

   @
   ### What changes were proposed in this PR?
   
   Deletes two generic helpers in the amber engine that have no production 
caller. Pure deletion, no behaviour change: **−268 lines**.
   
   | Removed | Lines | Why it is dead |
   | --- | ---: | --- |
   | `architecture/messaginglayer/OrderingEnforcer.scala` | 53 | last caller 
removed by #2208 |
   | `architecture/messaginglayer/OrderingEnforcerSpec.scala` | 150 | covers 
only the above |
   | `Utils.retry` (`engine/common/Utils.scala:72-87`) | 26 | only reference is 
its own tail-recursive call |
   | the three `Utils.retry` cases in `UtilsSpec.scala` | 35 | cover only the 
above |
   
   **`OrderingEnforcer`** was the extracted, generic form of the FIFO / 
exactly-once reorder buffer. #2208 ("Refactoring of amber engine", 2023-11-15) 
inlined that logic into `AmberFIFOChannel`, which still carries the identical 
header comment `/* The abstracted FIFO/exactly-once logic */` and re-declares 
the same members:
   
   ```
   OrderingEnforcer[T]  (deleted)        AmberFIFOChannel  (live, unchanged)
     ofoMap: LongMap[T]                    ofoMap: HashMap[Long, 
WorkflowFIFOMessage]
     current: Long                         current: Long
     isDuplicated / isAhead                isDuplicated / isAhead
     stash / enforceFIFO                   stash / enforceFIFO
   ```
   
   The generic copy has been stranded for two and a half years.
   
   > Reviewer note: there is a separate, **live** `OrderEnforcer` trait (no 
`-ing`) in `architecture/logreplay/`, used by 
`InputGateway`/`NetworkInputGateway`. It is unrelated and untouched — only the 
`messaginglayer` `OrderingEnforcer` is removed here.
   
   **`Utils.retry`** is an exponential-backoff combinator with no caller. Its 
`logger.warn` was the only use of the logger in `object Utils`, so this also 
drops `extends LazyLogging`, the `LazyLogging` import, and `import 
scala.annotation.tailrec` — leaving any of them would fail `scalafixAll 
--check`.
   
   Both symbols acquired unit tests during the 2026 coverage work (#4721, 
#4743), which is why they currently look live despite having been unreachable 
since 2023.
   
   Out of scope: retry/backoff is also hand-rolled in 
`LakeFSStorageClient.retryWithBackoff` and `FileService.awaitDependency`. 
Consolidating those two surviving copies is a separate follow-up.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7027
   
   ### How was this PR tested?
   
   Existing tests only — this PR adds none, since it removes code and the specs 
that covered it.
   
   Locally, from the repo root with Java 17:
   
   - `sbt "scalafixAll --check"` — clean (this is what catches the three 
now-unused imports).
   - `sbt scalafmtCheckAll` — clean.
   - `sbt "WorkflowExecutionService/testOnly 
org.apache.texera.amber.engine.common.UtilsSpec"` — 9 tests, all pass (was 12; 
the 3 removed are the `Utils.retry` cases).
   
   Verification that nothing references the removed code, re-runnable by a 
reviewer:
   
   ```
   git grep -nw OrderingEnforcer      # only the two deleted files
   git grep -n "Utils\.retry"         # only the deleted spec cases
   ```
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 5)
   @


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