chia7712 commented on a change in pull request #10498:
URL: https://github.com/apache/kafka/pull/10498#discussion_r613782042



##########
File path: clients/src/main/java/org/apache/kafka/common/record/Record.java
##########
@@ -132,4 +121,16 @@
      * @return the array of headers
      */
     Header[] headers();
+
+    static void ensureValid(Record record) {
+        if (record instanceof AbstractLegacyRecordBatch) {
+            ((AbstractLegacyRecordBatch) record).ensureValid();
+        }
+    }
+
+    static boolean isValid(Record record) {
+        if (record instanceof AbstractLegacyRecordBatch) {
+            return ((AbstractLegacyRecordBatch) record).isValid();
+        } else return true;

Review comment:
       thanks for nice suggestions. will copy that.




-- 
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.

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


Reply via email to