Repository navigation
Commit 1c4662b
authored
refactor(amber): collapse the single-subclass ReplayLogger hierarchy into one class (apache#7674)
### What changes were proposed in this PR?
Collapses the two-file `ReplayLogger` hierarchy into one concrete class.
apache#7452 removed `EmptyReplayLogger`, which left the abstract base with a
single subclass and no declared-type site anywhere:
| `ReplayLogger` | Subclasses | Declared-type sites |
| --- | ---: | --- |
| before apache#7452 | 2 | 1 — `EmptyReplayLoggerSpec.scala:125`, itself
deleted by apache#7452 |
| on `main` today | 1 | 0 |
```
ReplayLogManager.scala:109 private val replayLogger = new ReplayLoggerImpl() -> infers the concrete class
ReplayLoggerImpl.scala:31 class ReplayLoggerImpl extends ReplayLogger -> the only subclass
ReplayLogger.scala:28 abstract class ReplayLogger -> nothing else refers to it
```
So the base declared three abstract methods that exactly one class
implemented and that no call site dispatched through. Dropping it
removes `extends ReplayLogger`, one `override` keyword that no longer
overrides anything, and one of the two files. The three method bodies
move across untouched — no behaviour change.
**Naming.** The surviving class takes the plain `ReplayLogger` name.
With the base gone there is no abstraction left for an `...Impl` suffix
to distinguish it from, and the suffix would advertise an interface that
no longer exists. `ReplayLogManagerImpl` is unaffected — it does sit
beside a real `ReplayLogManager` trait in the same package.
```
before after
ReplayLogger.scala abstract class ReplayLogger ReplayLogger.scala class ReplayLogger
ReplayLoggerImpl.scala class ReplayLoggerImpl (deleted)
extends ReplayLogger
```
The rename touches one production call site
(`ReplayLogManager.scala:109`) and the `new ReplayLoggerImpl()`
constructions plus test names in `LogreplayPrimitivesSpec`. It also
fixes a stale `@param channel` in the Scaladoc, whose parameter has been
called `channelId` all along.
### Any related issues, documentation, discussions?
Closes apache#7673
### How was this PR tested?
Existing tests only — this is a structural change with no behaviour
change, and `LogreplayPrimitivesSpec` already covers the class by
constructing it directly, so it pins all three methods across the
refactor. Its only edits are the type name.
Locally, from the repo root with Java 17:
- `sbt "WorkflowExecutionService/Test/compile"` — success.
- `sbt "WorkflowExecutionService/testOnly *LogreplayPrimitivesSpec
*EmptyReplayLogManagerImplSpec *ReplayLogGeneratorSpec"` — all green.
- `sbt scalafmtCheckAll "scalafixAll --check"` — clean.
Verification, re-runnable by a reviewer:
```
git grep -rn ReplayLoggerImpl # empty — no Impl name survives
git grep -nw ReplayLogger -- '*.scala' | grep -v Spec # 2 hits: the class, and its one call site
```
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5)1 parent 256c2d1 commit 1c4662b
4 files changed
Lines changed: 65 additions & 105 deletions
File tree
- amber/src
- main/scala/org/apache/texera/amber/engine/architecture/logreplay
- test/scala/org/apache/texera/amber/engine/architecture/logreplay
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
| 29 | + | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
30 | 49 | | |
31 | 50 | | |
32 | 51 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
37 | 64 | | |
38 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
39 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
40 | 86 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
| 95 | + | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
| 167 | + | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
0 commit comments