mumrah commented on a change in pull request #9008:
URL: https://github.com/apache/kafka/pull/9008#discussion_r456449035



##########
File path: 
clients/src/main/java/org/apache/kafka/common/requests/FetchRequest.java
##########
@@ -492,74 +327,51 @@ public int maxBytes() {
     }
 
     public boolean isFromFollower() {
-        return replicaId >= 0;
+        return replicaId() >= 0;
     }
 
     public IsolationLevel isolationLevel() {
-        return isolationLevel;
+        return IsolationLevel.forId(data.isolationLevel());
     }
 
     public FetchMetadata metadata() {
         return metadata;
     }
 
     public String rackId() {
-        return rackId;
+        return data.rackId();
     }
 
     public static FetchRequest parse(ByteBuffer buffer, short version) {
-        return new FetchRequest(ApiKeys.FETCH.parseRequest(version, buffer), 
version);
+        ByteBufferAccessor accessor = new ByteBufferAccessor(buffer);
+        FetchRequestData message = new FetchRequestData();
+        message.read(accessor, version);
+        return new FetchRequest(message, version);
+    }
+
+    @Override
+    public ByteBuffer serialize(RequestHeader header) {

Review comment:
       Indeed this is generic serialization code for the message classes. If we 
go with a mixin interface to indicate a class has been converted over to 
generated messages, we could also push this up to AbstractRequest. However, 
this might be better saved for a follow-on since we'll probably want to pick up 
additional changes from @ijuma's PR. Thoughts?




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