showuon commented on code in PR #17524:
URL: https://github.com/apache/kafka/pull/17524#discussion_r1850128798


##########
clients/src/main/java/org/apache/kafka/common/requests/DescribeClusterRequest.java:
##########
@@ -51,6 +52,13 @@ public String toString() {
     public DescribeClusterRequest(DescribeClusterRequestData data, short 
version) {
         super(ApiKeys.DESCRIBE_CLUSTER, version);
         this.data = data;
+        validateVersionForIncludingFencedBrokers(version, 
data.includeFencedBrokers());
+    }
+
+    private void validateVersionForIncludingFencedBrokers(short version, 
boolean includeFencedBrokers) {
+        if (version < 2 && includeFencedBrokers) {
+            throw new UnsupportedVersionException("Including fenced broker 
endpoints is not supported with version " + version);
+        }

Review Comment:
   In the generated 
clients/build/generated/main/java/org/apache/kafka/common/message/DescribeClusterRequestData.java,
 the `UnsupportedVersionException` will be thrown when trying to add 
`includeFencedBrokers` into version < 2, so we don't have to do it by our own 
here.



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