HDDS-7753. Simplify DatanodeDetails#toString to improve log messages#4161
Merged
adoroszlai merged 6 commits intoapache:masterfrom Jan 10, 2023
Merged
HDDS-7753. Simplify DatanodeDetails#toString to improve log messages#4161adoroszlai merged 6 commits intoapache:masterfrom
adoroszlai merged 6 commits intoapache:masterfrom
Conversation
Contributor
|
@xBis7 can you please take a look? |
sodonnel
approved these changes
Jan 9, 2023
Contributor
sodonnel
left a comment
There was a problem hiding this comment.
LGTM - I think this is a good change, as the current toString() on datanodeDetails is used in a lot of places and it is very verbose. It makes the logs hard to read when debugging an issue, when all you often want to know is what DN a command is targeted for etc.
Contributor
Author
|
Thanks @sodonnel for the review. |
jojochuang
pushed a commit
to jojochuang/ozone
that referenced
this pull request
Feb 6, 2023
…pache#4161) (cherry picked from commit 4531701) Change-Id: I897e030c5a2b307879556ea25be53567c1dfe88c
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.
What changes were proposed in this pull request?
DatanodeDetails#toStringoutputs too much detail for it to be usable in each and every log message related to datanodes. Thus log statements currently have to build their own output (e.g. for list of hosts, etc.), leading to duplication.This PR replaces
toStringwith less verbose implementation, but keeps the current one for occasional usage astoDebugString.https://issues.apache.org/jira/browse/HDDS-7753
How was this patch tested?
Checked for log messages in
TestECContainerRecoveryoutput.Regular CI:
https://github.com/adoroszlai/hadoop-ozone/actions/runs/3875394666