You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "satishd (via GitHub)" <gi...@apache.org> on 2023/03/18 01:19:44 UTC

[GitHub] [kafka] satishd commented on a diff in pull request #13362: KAFKA-14795: Provide message formatter for RemoteLogMetadata

satishd commented on code in PR #13362:
URL: https://github.com/apache/kafka/pull/13362#discussion_r1140880048


##########
storage/src/main/java/org/apache/kafka/server/log/remote/metadata/storage/serialization/RemoteLogMetadataSerde.java:
##########
@@ -107,4 +110,13 @@ private RemoteLogMetadataTransform remoteLogMetadataTransform(short apiKey) {
 
         return metadataTransform;
     }
+
+    public static class RemoteLogMetadataFormatter implements MessageFormatter {
+        private final RemoteLogMetadataSerde remoteLogMetadataSerde = new RemoteLogMetadataSerde();
+
+        @Override
+        public void writeTo(ConsumerRecord<byte[], byte[]> consumerRecord, PrintStream output) {
+            output.println(remoteLogMetadataSerde.deserialize(consumerRecord.value()).toString());

Review Comment:
   It is good to include offset and partition, which will be helpful for debugging.
   
   ```
   output.printf("offset: %d, partition: %d, value: %s%n", record.offset(), record.partition(), remoteLogMetadataSerde.deserialize(consumerRecord.value()).toString());
   ```



-- 
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-unsubscribe@kafka.apache.org

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