OmniaGM commented on code in PR #24129:
URL: https://github.com/apache/kafka/pull/24129#discussion_r4588984283
##########
tools/src/main/java/org/apache/kafka/tools/consumer/MirrorStateMessageFormatter.java:
##########
@@ -47,8 +47,8 @@ protected JsonNode keyAsJson(ApiMessage message) {
protected JsonNode valueAsJson(ApiMessage message, short version) {
JsonNode json =
CoordinatorRecordJsonConverters.writeRecordValueAsJson(message, version);
if (message instanceof MirrorPartitionStateValue state) {
- ((ObjectNode) json).put("state",
MirrorPartitionState.nameOf(state.state()));
- ((ObjectNode) json).put("previousState",
MirrorPartitionState.nameOf(state.previousState()));
+ ((ObjectNode) json).put("stateName",
MirrorPartitionState.nameOf(state.state()));
Review Comment:
Actually should we do the same in
`DumpLogSegments.MirrorStateMessageParser`? It still replaces
`state`/`previousState` with the names, so after this PR `kafka-dump-log
--mirror-state-decoder` prints `"state":"FAILED"` while the formatter prints
`"state":8` plus `stateName`. Keeping them consistent would make the output of
both tools look the same. WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]