-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
KAFKA-4108: Improve DumpLogSegments offsets-decoder output format #1937
Conversation
21c0f9b
to
a1a70aa
Compare
732ca82
to
7d88e71
Compare
7d88e71
to
d952770
Compare
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
@hachikuji, does this seem OK to you? |
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.
Thanks for the patch. Couple questions.
val keyString = Json.encode(Map("metadata" -> groupId)) | ||
val valueString = Json.encode(Map( | ||
"protocolType" -> protocolType, | ||
"groupMetadata.protocol" -> group.protocol, |
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.
Out of curiosity, why do we use the "groupMetadata" prefix?
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.
Hmm, it's been a while :) Perhaps to somehow reflect the object/value they are describing. I could remove the prefix in the next update.
"protocolType" -> protocolType, | ||
"groupMetadata.protocol" -> group.protocol, | ||
"groupMetadata.generationId" -> group.generationId, | ||
"assignment" -> assignment)) |
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.
Should we jsonify the assignment too, or do you think it's ok as is?
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.
This assignment
value is already stringified in the previous block. So I think we could keep it.
This PR improves the output format of DumpLogSegments when the `--offset-decoder` option is used for consuming `__consumer_offsets`, especially when it comes to group metadata. An example of the partial output with existing formatting: ``` key: metadata::console-consumer-40190 payload: consumer:range:1:{consumer-1-20240b92-fbf4-44d5-bf8c-66b6d70c9948=[foo-0]} ``` An example of the same output with suggested formatting: ``` key: {"metadata":"console-consumer-40190"} payload: {"protocolType":"consumer","groupMetadata.protocol":"range","groupMetadata.generationId":1,"assignment":"{consumer-1-20240b92-fbf4-44d5-bf8c-66b6d70c9948=[foo-0]}"} ```
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.
@hachikuji Thanks for taking a look. I'll submit an update shortly to address your comments.
val keyString = Json.encode(Map("metadata" -> groupId)) | ||
val valueString = Json.encode(Map( | ||
"protocolType" -> protocolType, | ||
"groupMetadata.protocol" -> group.protocol, |
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.
Hmm, it's been a while :) Perhaps to somehow reflect the object/value they are describing. I could remove the prefix in the next update.
"protocolType" -> protocolType, | ||
"groupMetadata.protocol" -> group.protocol, | ||
"groupMetadata.generationId" -> group.generationId, | ||
"assignment" -> assignment)) |
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.
This assignment
value is already stringified in the previous block. So I think we could keep it.
d952770
to
5ace58d
Compare
Anything preventing this from being merged? Code freeze is tomorrow. |
Thanks for the heads-up. Just waiting for @hachikuji's feedback on my responses above and the new commit. |
LGTM. I went back to the JIRA and was surprised to find that I filed this issue 😝 . |
This PR improves the output format of DumpLogSegments when the
--offset-decoder
option is used for consuming__consumer_offsets
, especially when it comes to group metadata.An example of the partial output with existing formatting:
An example of the same output with suggested formatting: