cmccabe commented on code in PR #14545:
URL: https://github.com/apache/kafka/pull/14545#discussion_r1366008719


##########
clients/src/main/java/org/apache/kafka/common/requests/LeaderAndIsrRequest.java:
##########
@@ -42,26 +42,52 @@
 
 public class LeaderAndIsrRequest extends AbstractControlRequest {
 
+    public enum Type {
+        None(0),
+        Incremental(1),
+        Full(2);
+
+        private final byte type;
+        Type(int type) {
+            this.type = (byte) type;
+        }
+
+        public byte asByte() {
+            return type;
+        }
+
+        public static Type fromByte(byte type) {
+            for (Type t : Type.values()) {
+                if (t.type == type) {
+                    return t;
+                }
+            }
+            throw new IllegalArgumentException("No Type enum for value " + 
type);

Review Comment:
   Should translate unknown values to UNKNOWN for forwards-compatibility 
(although it probably doesn't matter here since this RPC is going away)



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