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


##########
clients/src/main/resources/common/message/ConsumerGroupDescribeResponse.json:
##########
@@ -69,7 +70,9 @@
             { "name": "Assignment", "type": "Assignment", "versions": "0+",
               "about": "The current assignment." },
             { "name": "TargetAssignment", "type": "Assignment", "versions": 
"0+",
-              "about": "The target assignment." }
+              "about": "The target assignment." },
+            { "name": "IsClassic", "type": "bool", "versions": "1+", 
"ignorable": true,
+              "about": "True for classic member." }

Review Comment:
   > I personally prefer to have a bit more complexity on the server rather 
than relying on all the developers of clients to do the right thing.
   
   I tried to imagine the code for both schemas.
   
   ### int8
   
   client code
   ```java
   switch (data.isClassic()) {
     case 0: return Optional.of(false);
     case 1: return Optional.of(true);
     default: return Optional.empty();
   }
   ```
   server code
   ```java
   data.setIsClassic(useClassicProtocol ? 1 : 0);
   ```
   ---
   ### bool
   
   client code
   ```java
   if (version < 1) return Optional.empty();
   return Optional.of(data.isClassic());
   ```
   
   server
   ```java
   data.setIsClassic(useClassicProtocol);
   ```
   ---
   
   if I'm imagining correctly, it seems that using a bool could simplify the 
code.
   
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to