smjn commented on code in PR #17467:
URL: https://github.com/apache/kafka/pull/17467#discussion_r1796706353


##########
core/src/main/scala/kafka/tools/DumpLogSegments.scala:
##########
@@ -628,6 +630,68 @@ object DumpLogSegments {
     }
   }
 
+  // for test visibility
+  class ShareGroupStateMessageParser extends MessageParser[String, String] {
+    private val serde = new ShareCoordinatorRecordSerde()
+
+    private def prepareKey(message: Message, version: Short): String = {
+      val messageAsJson = message match {
+        case m: ShareSnapshotKey =>
+          ShareSnapshotKeyJsonConverter.write(m, version)
+        case m: ShareUpdateKey =>
+          ShareUpdateKeyJsonConverter.write(m, version)
+        case _ => throw new IllegalStateException(s"Message key 
${message.getClass.getSimpleName} is not supported.")

Review Comment:
   `UnknownRecordTypeException` will produce less human readable messages as it 
only allows recordType (short)  as the constructor argument.
   Using `IllegalStateException` we can actually specify the name of the record 
class and more readable message.
   
   Will update for key



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to