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



##########
File path: clients/src/main/resources/common/message/README.md
##########
@@ -157,9 +157,6 @@ meaning of the request, such as a "validateOnly" boolean, 
should not be ignored.
 It's often useful to know how much space a message will take up before writing
 it out to a buffer.  You can find this out by calling the Message#size method.
 
-You can also convert a message to a Struct by calling Message#toStruct.  This
-allows you to use the functions that serialize Structs to buffers.
-
 Deserializing Messages
 ----------------------
 Message objects may be deserialized using the Message#read method.  This method

Review comment:
       There is another invalid description.
   
   ```
   You can also deserialize a message from a Struct by calling 
Message#fromStruct.
   The Struct will not be modified.
   ```

##########
File path: 
clients/src/test/java/org/apache/kafka/common/requests/OffsetFetchResponseTest.java
##########
@@ -107,20 +107,21 @@ public void testStructBuild() {
         OffsetFetchResponse latestResponse = new 
OffsetFetchResponse(throttleTimeMs, Errors.NONE, partitionDataMap);
 
         for (short version = 0; version <= 
ApiKeys.OFFSET_FETCH.latestVersion(); version++) {
-            Struct struct = latestResponse.data().toStruct(version);
+            OffsetFetchResponseData data = new OffsetFetchResponseData(
+                new ByteBufferAccessor(latestResponse.serialize(version)), 
version);
 
-            OffsetFetchResponse oldResponse = 
OffsetFetchResponse.parse(latestResponse.serialize(version), version);
+            OffsetFetchResponse oldResponse = new OffsetFetchResponse(data, 
version);
 
             if (version <= 1) {
-                assertFalse(struct.hasField(ERROR_CODE));

Review comment:
       the field "ERROR_CODE" is never used.




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