BP-69: Remove bookkeeper-slogger module#4764
Open
merlimat wants to merge 1 commit intoapache:masterfrom
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of BP-69 (SLF4J → slog migration). Now that the codebase has fully moved to the external
io.github.merlimat.slog:sloglibrary, the legacy in-treebookkeeper-sloggermodule is dead weight and is removed.What changed
Callsite conversion — 14 files in
bookkeeper-server(5 main, 9 test) converted from the legacyorg.apache.bookkeeper.slogger.SloggerAPI to slogLogger: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.CONSOLELogger.get(TestClass.class)Eventsenum removed. The 21 callsites that referenceddirectentrylogger/Events.javanow 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:
bookkeeper-slogger/directory tree (api + slf4j-bridge + tests).<module>bookkeeper-slogger</module>from rootpom.xml.bookkeeper-slogger-api/bookkeeper-slogger-slf4jdeps frombookkeeper-server/pom.xml.Stats
34 files changed, +180 / −1549 lines.
Test plan
mvn -pl bookkeeper-server compile checkstyle:checkcleanTest*EntryLog*/Test*Direct*/GarbageCollectorThreadTesttests pass (verified locally — 64/64)