chia7712 commented on code in PR #15935:
URL: https://github.com/apache/kafka/pull/15935#discussion_r1598750305


##########
clients/src/main/java/org/apache/kafka/common/protocol/Readable.java:
##########
@@ -53,7 +54,7 @@ default List<RawTaggedField> 
readUnknownTaggedField(List<RawTaggedField> unknown
         return unknowns;
     }
 
-    default MemoryRecords readRecords(int length) {
+    default BaseRecords readRecords(int length) {

Review Comment:
   in kafak serialization, we assume the impl of `BaseRecords` is 
`MemoryRecords`. For example:
   ```java
           @Override
           public PartitionProduceData duplicate() {
               PartitionProduceData _duplicate = new PartitionProduceData();
               _duplicate.index = index;
               if (records == null) {
                   _duplicate.records = null;
               } else {
                   _duplicate.records = 
MemoryRecords.readableRecords(((MemoryRecords) records).buffer().duplicate());
               }
               return _duplicate;
           }
   ```
   
   Hence, I'm not sure how this change works if you introduce a 
non-MemoryRecords impl.



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