Skip to content

refactor(amber): collapse the single-subclass ReplayLogger hierarchy into one class - #7674

Merged
aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:refactor/collapse-replay-logger-base
Aug 17, 2026
Merged

refactor(amber): collapse the single-subclass ReplayLogger hierarchy into one class#7674
aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:refactor/collapse-replay-logger-base

Conversation

@aglinxinyuan

@aglinxinyuan aglinxinyuan commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Collapses the two-file ReplayLogger hierarchy into one concrete class. #7452 removed EmptyReplayLogger, which left the abstract base with a single subclass and no declared-type site anywhere:

ReplayLogger Subclasses Declared-type sites
before #7452 2 1 — EmptyReplayLoggerSpec.scala:125, itself deleted by #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 #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)

Copilot AI lite review requested due to automatic review settings August 15, 2026 02:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @Yicong-Huang
    You can notify them by mentioning @Yicong-Huang in a comment.

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 0 better · 🔴 5 worse · ⚪ 10 noise (<±5%) · 0 without baseline

Compared against main 1011ff7 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 351 0.214 29,782/38,923/38,923 us 🔴 +25.8% / 🔴 +140.7%
🔴 bs=100 sw=10 sl=64 820 0.501 119,104/164,217/164,217 us 🔴 +9.2% / 🔴 +55.5%
bs=1000 sw=10 sl=64 939 0.573 1,061,431/1,137,708/1,137,708 us ⚪ within ±5% / 🔴 +12.4%
Baseline details

Latest main 1011ff7 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 351 tuples/sec 406 tuples/sec 784.16 tuples/sec -13.5% -55.2%
bs=10 sw=10 sl=64 MB/s 0.214 MB/s 0.248 MB/s 0.479 MB/s -13.7% -55.3%
bs=10 sw=10 sl=64 p50 29,782 us 23,675 us 12,626 us +25.8% +135.9%
bs=10 sw=10 sl=64 p95 38,923 us 39,242 us 16,169 us -0.8% +140.7%
bs=10 sw=10 sl=64 p99 38,923 us 39,242 us 18,986 us -0.8% +105.0%
bs=100 sw=10 sl=64 throughput 820 tuples/sec 838 tuples/sec 1,023 tuples/sec -2.1% -19.9%
bs=100 sw=10 sl=64 MB/s 0.501 MB/s 0.511 MB/s 0.625 MB/s -2.0% -19.8%
bs=100 sw=10 sl=64 p50 119,104 us 114,695 us 99,185 us +3.8% +20.1%
bs=100 sw=10 sl=64 p95 164,217 us 150,442 us 105,616 us +9.2% +55.5%
bs=100 sw=10 sl=64 p99 164,217 us 150,442 us 113,681 us +9.2% +44.5%
bs=1000 sw=10 sl=64 throughput 939 tuples/sec 944 tuples/sec 1,057 tuples/sec -0.5% -11.1%
bs=1000 sw=10 sl=64 MB/s 0.573 MB/s 0.576 MB/s 0.645 MB/s -0.5% -11.2%
bs=1000 sw=10 sl=64 p50 1,061,431 us 1,056,327 us 965,435 us +0.5% +9.9%
bs=1000 sw=10 sl=64 p95 1,137,708 us 1,120,087 us 1,012,135 us +1.6% +12.4%
bs=1000 sw=10 sl=64 p99 1,137,708 us 1,120,087 us 1,042,088 us +1.6% +9.2%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,570.00,200,128000,351,0.214,29782.37,38922.54,38922.54
1,100,10,64,20,2438.33,2000,1280000,820,0.501,119103.75,164216.62,164216.62
2,1000,10,64,20,21291.82,20000,12800000,939,0.573,1061430.68,1137708.26,1137708.26

@codecov-commenter

codecov-commenter commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.95%. Comparing base (1011ff7) to head (d844b3b).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...r/engine/architecture/logreplay/ReplayLogger.scala 94.44% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7674      +/-   ##
============================================
+ Coverage     90.93%   90.95%   +0.01%     
- Complexity     4452     4455       +3     
============================================
  Files          1175     1174       -1     
  Lines         47140    47139       -1     
  Branches       5284     5284              
============================================
+ Hits          42869    42873       +4     
+ Misses         2581     2580       -1     
+ Partials       1690     1686       -4     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from 1011ff7
agent-service 98.62% <ø> (ø) Carriedforward from 1011ff7
amber 87.42% <94.73%> (+0.02%) ⬆️
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from 1011ff7
config-service 86.73% <ø> (ø) Carriedforward from 1011ff7
file-service 68.90% <ø> (ø) Carriedforward from 1011ff7
frontend 92.44% <ø> (ø) Carriedforward from 1011ff7
notebook-migration-service 83.74% <ø> (ø) Carriedforward from 1011ff7
pyamber 97.57% <ø> (ø) Carriedforward from 1011ff7
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from 1011ff7

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Aug 17, 2026
### What changes were proposed in this PR?

CI has been red repo-wide since 2026-08-16 ~02:00 UTC — `main`, the
merge queue, and every PR that runs a Scala stack. The jobs die in 3–7s
during *Prepare all required actions*, before checkout, so they produce
no test output at all.

The cause is the ASF actions allowlist, not anything in this repository.
`sbt/setup-sbt` reaches a nested `carabiner-dev` action that is no
longer permitted:

```
.github/workflows/*.yml
  └─ sbt/setup-sbt@6444f4c                              v1.5.2   allowed
       └─ carabiner-dev/actions@94f2939    v1.2.1   allowed
            └─ carabiner-dev/actions@2a11d59   v1.1.7   BLOCKED
```

> The action
carabiner-dev/actions@2a11d59
is not allowed in apache/texera because all actions must be from a
repository owned by your enterprise, created by GitHub, or match one of
the patterns: …

Nothing in the tree changed — every link in that chain is SHA-pinned,
and the `sbt/setup-sbt` pin last moved in apache#6710 on 2026-07-22. The same
`2a11d59` downloaded successfully at `2026-08-15T02:01Z` (apache#7674's amber
job) and is rejected at `2026-08-17T02:13Z`. Last clean run before the
break: merge-queue `pr-7699` at `2026-08-16T01:52:00Z`; first failure:
`main` at `2026-08-16T02:04:42Z`.

This bumps all 9 call sites from v1.5.2 to v1.5.7, which resolves down a
different path:

| | v1.5.2 (current) | v1.5.7 (this PR) |
| --- | --- | --- |
| `ampel/verify` | `94f2939` (v1.2.1) | `36a39ef` (v1.2.6) |
| `install/ampel` | **`2a11d59` — blocked** | `2fec8bd8` |
| `install/bnd` | `2a11d59` | no longer referenced |

Call sites: `benchmarks.yml` (1), `build-and-push-images.yml` (3),
`build.yml` (4), `dependency-graph.yml` (1).

> Reviewer note — one thing I could not verify up front. The org
allowlist is not readable without repo-admin (`403`), and the error
message truncates the pattern list before the `carabiner-dev` entries,
so I could not confirm in advance that `2fec8bd8` is permitted. **This
PR's own CI run is the experiment.** If it fails on the same error, the
bump is a dead end and the fallback is an INFRA request to re-allow
`carabiner-dev/actions@2a11d59a135c5e291f305f249a92ad7903e3ee0f`.

### Any related issues, documentation, discussions?

No issue filed — the regression originates outside the repository and
this PR is the unblock. The previous bump of this pin was apache#6710.

### How was this PR tested?

By this PR's CI, which is the only place the failure reproduces — it
depends on the `apache/texera` actions policy and cannot be triggered
locally or on a fork.

The change touches `.github/**`, so the labeler applies `ci`, and `ci`
maps to every stack in `LABEL_STACKS` (`.github/workflows/precheck.yml`)
— `frontend`, `amber`, `amber-integration`, `platform`,
`platform-integration`, `pyamber`, `agent-service`, `infra`,
`pyright-language-service` — plus `Bench`. Every job that consumes
`sbt/setup-sbt` is therefore exercised here.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5)

@Yicong-Huang Yicong-Huang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 0 must-fix · 2 advisory · 1 polish — the hierarchy collapse is behaviorally safe, with two recommendations and one documentation touch-up.

Design & architecture (1)

  • ReplayLoggerImpl.scala:31 — rename the remaining concrete type to ReplayLogger to complete the collapse (advisory, see inline)

Conventions (1)

  • Description: remove the stale statement that #7452 still needs to merge, and rebase the stacked branch (advisory)

Polish: 1 quick touch-up (see inline comments).

…into one class

After EmptyReplayLogger was removed, the abstract base ReplayLogger had one
subclass and was never named as a type: ReplayLogManagerImpl builds it as
`new ReplayLoggerImpl()`, so the inferred type is the concrete class.

Merges the two into a single `class ReplayLogger` in ReplayLogger.scala,
dropping `extends ReplayLogger` and the now-meaningless `override`. The Impl
suffix goes with the base -- it advertised an interface that no longer exists.
The three method bodies are untouched; no behaviour change.

Also fixes a stale `@param channel` in the Scaladoc; the parameter has been
called channelId all along.
@aglinxinyuan
aglinxinyuan force-pushed the refactor/collapse-replay-logger-base branch from a76889e to d844b3b Compare August 17, 2026 05:38
@aglinxinyuan aglinxinyuan changed the title refactor(amber): collapse the single-subclass ReplayLogger base into ReplayLoggerImpl refactor(amber): collapse the single-subclass ReplayLogger hierarchy into one class Aug 17, 2026
@aglinxinyuan

Copy link
Copy Markdown
Contributor Author

Thanks @Yicong-Huang — all three addressed, force-pushed as d844b3b.

Item Status
Rename the concrete type to ReplayLogger Done — ReplayLoggerImpl is gone, git grep -rn ReplayLoggerImpl is empty
Scaladoc @param channel@param channelId Done, with the @param block re-aligned
Stale #7452 note + rebase Rebased onto main; git dropped the already-merged commit, so the branch is a single commit now, and the note is out of the description

The description is rewritten around the new naming rather than the old "keeps its name" argument, since your point stands: with the base deleted there is no abstraction for ...Impl to distinguish against.

Re-verified locally from the repo root on Java 17:

  • sbt "WorkflowExecutionService/Test/compile" — success
  • sbt "WorkflowExecutionService/testOnly *LogreplayPrimitivesSpec *EmptyReplayLogManagerImplSpec *ReplayLogGeneratorSpec" — 33 tests, all green
  • sbt scalafmtCheckAll "scalafixAll --check" — clean

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Aug 17, 2026
Merged via the queue into apache:main with commit 1c4662b Aug 17, 2026
25 checks passed
@aglinxinyuan
aglinxinyuan deleted the refactor/collapse-replay-logger-base branch August 17, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine refactor Refactor the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collapse the single-subclass ReplayLogger base into ReplayLoggerImpl

4 participants