chia7712 commented on code in PR #22615:
URL: https://github.com/apache/kafka/pull/22615#discussion_r3499195009
##########
tools/src/main/java/org/apache/kafka/tools/DumpLogSegments.java:
##########
@@ -725,8 +727,13 @@ protected JsonNode keyAsJson(ApiMessage message) {
@Override
protected JsonNode valueAsJson(ApiMessage message, short version) {
- return
org.apache.kafka.coordinator.transaction.generated.CoordinatorRecordJsonConverters
+ JsonNode json =
org.apache.kafka.coordinator.transaction.generated.CoordinatorRecordJsonConverters
.writeRecordValueAsJson(message, version);
+ if (message instanceof TransactionLogValue) {
+ ((ObjectNode) json).put("transactionStatus",
+ TransactionState.fromId(((TransactionLogValue)
message).transactionStatus()).stateName());
Review Comment:
Should we consider forward compatibility? For example, if a newer version of
Kafka adds a new `TransactionState`, what happens when a user uses an older
version of the tool to parse the logs?
--
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]