chia7712 commented on a change in pull request #10498:
URL: https://github.com/apache/kafka/pull/10498#discussion_r613773275
##########
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:
The method “isVaild” is meaningless for v2 and later. It seems to me it
is not worth being a interface. If this change is overkill, alternative is that
we can add default implementation to those stale methods. The v2 and later can
skip implementation of stale methods.
--
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:
[email protected]