Skip to content

BP-69: Remove bookkeeper-slogger module#4764

Open
merlimat wants to merge 1 commit intoapache:masterfrom
merlimat:bp-69-remove-slogger
Open

BP-69: Remove bookkeeper-slogger module#4764
merlimat wants to merge 1 commit intoapache:masterfrom
merlimat:bp-69-remove-slogger

Conversation

@merlimat
Copy link
Copy Markdown
Contributor

Summary

Part of BP-69 (SLF4J → slog migration). Now that the codebase has fully moved to the external io.github.merlimat.slog:slog library, the legacy in-tree bookkeeper-slogger module is dead weight and is removed.

What changed

Callsite conversion — 14 files in bookkeeper-server (5 main, 9 test) converted from the legacy org.apache.bookkeeper.slogger.Slogger API to slog Logger:

Old New
new Slf4jSlogger(Foo.class) Logger.get(Foo.class)
slog.kv("k", v).info(Events.X) log.info().attr("k", v).log("Phrase")
slog.kv(...).error(Events.X, t) log.error().exception(t).attr(...).log("Phrase")
slogParent.kv("dir", d).ctx(Foo.class) Logger.get(Foo.class).with().ctx(parent).attr("dir", d).build()
Slogger.NULL / Slogger.CONSOLE Logger.get(TestClass.class)

Events enum removed. The 21 callsites that referenced directentrylogger/Events.java now use natural-English phrases inline (e.g. Events.COMPACTION_ABORT_EXCEPTION"Compaction aborted", Events.LOG_ROLL"Rolling to new log file"). The token-style enum names were a Slogger-era convention; slog event names live in the message text alongside the structured attrs.

Module removal:

  • Deleted bookkeeper-slogger/ directory tree (api + slf4j-bridge + tests).
  • Removed <module>bookkeeper-slogger</module> from root pom.xml.
  • Removed both bookkeeper-slogger-api / bookkeeper-slogger-slf4j deps from bookkeeper-server/pom.xml.

Stats

34 files changed, +180 / −1549 lines.

Test plan

  • mvn -pl bookkeeper-server compile checkstyle:check clean
  • All Test*EntryLog* / Test*Direct* / GarbageCollectorThreadTest tests pass (verified locally — 64/64)
  • Full CI matrix green

Convert the remaining bookkeeper-slogger callsites in bookkeeper-server
to the slog library and remove the bookkeeper-slogger module entirely.

Conversion mapping:
- new Slf4jSlogger(Foo.class)                  → Logger.get(Foo.class)
- slog.kv("k", v).info(Events.X)               → log.info().attr("k", v).log(Events.X.toString())
- slog.kv(...).warn/error(Events.X, t)         → log.warn/error().exception(t).attr(...).log(Events.X.toString())
- slogParent.kv("dir", d).ctx(Foo.class)       → Logger.get(Foo.class).with().ctx(parent).attr("dir", d).build()
- Slogger.NULL / Slogger.CONSOLE in tests      → Logger.get(TestClass.class)

Files converted:
- 5 main: DirectEntryLogger, DirectWriter, DirectCompactionEntryLog,
  EntryLogIdsImpl, DbLedgerStorage
- 9 tests: GarbageCollectorThreadTest, EntryLogTestUtils, TestMetadata,
  TestTransactionalEntryLogCompactor, TestDirectWriter,
  TestDirectEntryLogger, TestDirectReader, TestDirectEntryLoggerCompat,
  TestEntryLogIds

Module removal:
- Removed bookkeeper-slogger/ directory tree (api + slf4j + tests).
- Dropped <module>bookkeeper-slogger</module> from root pom.xml.
- Dropped bookkeeper-slogger-api / bookkeeper-slogger-slf4j deps from
  bookkeeper-server/pom.xml.

Verified: mvn -pl bookkeeper-server compile checkstyle:check passes;
all 64 tests under Test*EntryLog* / Test*Direct* / GarbageCollectorThreadTest
/ TestMetadata pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant