-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make slogger use current class #3994
Merged
zymap
merged 2 commits into
apache:master
from
hangc0276:chenhang/make_slogger_use_current_class
Jun 20, 2023
Merged
Make slogger use current class #3994
zymap
merged 2 commits into
apache:master
from
hangc0276:chenhang/make_slogger_use_current_class
Jun 20, 2023
Conversation
This file contains 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
eolivelli
approved these changes
Jun 19, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
zymap
approved these changes
Jun 20, 2023
zymap
pushed a commit
that referenced
this pull request
Jun 20, 2023
### Motivation We use Slogger to support DirectIO Entrylogger and create the slogger instance in DbLedgerStorage and passed down to DirectIOEntrylogger. However, in the subclasses, we generate a new Slogger instance without setting the context, which leads to the Slogger instance belonging to DbLedgerStorage or Slf4j. The broker logs are as follows. ``` 2023-06-19T15:21:56,518+0800 [main] INFO org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage - ENTRYLOG_IDS_CANDIDATES_SELECTED 2023-06-19T15:21:56,561+0800 [main] INFO org.apache.bookkeeper.slogger.slf4j.Slf4jSlogger {directory=data/bookkeeper/ledgers/current, event=ENTRYLOGGER_CREATED, maxCachedReaders=32, maxCachedReadersPerThread=4, maxFileSize=1073741824, maxSaneEntrySize=5252620, perThreadBufferSize=33554432, readBufferSize=8388608, singleWriteBufferSize=33554432, totalReadBufferSize=268435456, totalWriteBufferSize=268435456} - ENTRYLOGGER_CREATED ``` Without the specific slogger instance name, it will be hard to configure a specific class to enable KV logger configuration. ### Modification Set the specific class context for each subclass slogger instance. After this change, the broker logs are as follows. ``` 2023-06-19T16:01:56,685+0800 [main] INFO org.apache.bookkeeper.bookie.storage.directentrylogger.EntryLogIdsImpl {dirs=[data/bookkeeper/ledgers/current], durationMs=0, event=ENTRYLOG_IDS_CANDIDATES_SELECTED, maxId=21474836 47, nextId=0} - ENTRYLOG_IDS_CANDIDATES_SELECTED 2023-06-19T16:01:56,721+0800 [main] INFO org.apache.bookkeeper.bookie.storage.directentrylogger.DirectEntryLogger {directory=data/bookkeeper/ledgers/current, event=ENTRYLOGGER_CREATED, maxCachedReaders=32, maxCachedReader sPerThread=4, maxFileSize=1073741824, maxSaneEntrySize=5252620, perThreadBufferSize=33554432, readBufferSize=8388608, singleWriteBufferSize=33554432, totalReadBufferSize=268435456, totalWriteBufferSize=268435456} - ENTRYLO GGER_CREATED ``` (cherry picked from commit 8085f66)
Ghatage
pushed a commit
to sijie/bookkeeper
that referenced
this pull request
Jul 12, 2024
### Motivation We use Slogger to support DirectIO Entrylogger and create the slogger instance in DbLedgerStorage and passed down to DirectIOEntrylogger. However, in the subclasses, we generate a new Slogger instance without setting the context, which leads to the Slogger instance belonging to DbLedgerStorage or Slf4j. The broker logs are as follows. ``` 2023-06-19T15:21:56,518+0800 [main] INFO org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage - ENTRYLOG_IDS_CANDIDATES_SELECTED 2023-06-19T15:21:56,561+0800 [main] INFO org.apache.bookkeeper.slogger.slf4j.Slf4jSlogger {directory=data/bookkeeper/ledgers/current, event=ENTRYLOGGER_CREATED, maxCachedReaders=32, maxCachedReadersPerThread=4, maxFileSize=1073741824, maxSaneEntrySize=5252620, perThreadBufferSize=33554432, readBufferSize=8388608, singleWriteBufferSize=33554432, totalReadBufferSize=268435456, totalWriteBufferSize=268435456} - ENTRYLOGGER_CREATED ``` Without the specific slogger instance name, it will be hard to configure a specific class to enable KV logger configuration. ### Modification Set the specific class context for each subclass slogger instance. After this change, the broker logs are as follows. ``` 2023-06-19T16:01:56,685+0800 [main] INFO org.apache.bookkeeper.bookie.storage.directentrylogger.EntryLogIdsImpl {dirs=[data/bookkeeper/ledgers/current], durationMs=0, event=ENTRYLOG_IDS_CANDIDATES_SELECTED, maxId=21474836 47, nextId=0} - ENTRYLOG_IDS_CANDIDATES_SELECTED 2023-06-19T16:01:56,721+0800 [main] INFO org.apache.bookkeeper.bookie.storage.directentrylogger.DirectEntryLogger {directory=data/bookkeeper/ledgers/current, event=ENTRYLOGGER_CREATED, maxCachedReaders=32, maxCachedReader sPerThread=4, maxFileSize=1073741824, maxSaneEntrySize=5252620, perThreadBufferSize=33554432, readBufferSize=8388608, singleWriteBufferSize=33554432, totalReadBufferSize=268435456, totalWriteBufferSize=268435456} - ENTRYLO GGER_CREATED ```
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.
Motivation
We use Slogger to support DirectIO Entrylogger and create the slogger instance in DbLedgerStorage and passed down to DirectIOEntrylogger. However, in the subclasses, we generate a new Slogger instance without setting the context, which leads to the Slogger instance belonging to DbLedgerStorage or Slf4j. The broker logs are as follows.
Without the specific slogger instance name, it will be hard to configure a specific class to enable KV logger configuration.
Modification
Set the specific class context for each subclass slogger instance.
After this change, the broker logs are as follows.