hachikuji commented on a change in pull request #10066:
URL: https://github.com/apache/kafka/pull/10066#discussion_r571501194



##########
File path: generator/src/main/java/org/apache/kafka/message/RequestApiScope.java
##########
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.message;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public enum RequestApiScope {
+    @JsonProperty("zkBroker")
+    ZK_BROKER,
+
+    @JsonProperty("broker")
+    BROKER,
+
+    @JsonProperty("controller")
+    CONTROLLER,
+
+    @JsonProperty("raft")
+    RAFT;

Review comment:
       I had something like that originally, but I found it simpler to have a 
1-1 mapping from listener to scope. All "CLIENT" APIs have to be present on 
both the zk and raft brokers, but it alone doesn't give us a way to distinguish 
between the two. We could have "ZK_CLIENT" and "RAFT_CLIENT" as an alternative. 
Then I guess we would also still need "ZK_BROKER" and "RAFT_BROKER." In any 
case, then each listener might have multiple scopes, which is a little more 
complex.
   
   Perhaps this would be clearer if we had a name tying this back the listener 
more directly. Maybe we should get rid of the "scope" term and just call it 
"listeners"?
   
   ```json
   "listeners": ["broker", "controller"]
   ```
   
   By the way, you probably saw it already, but the "raft" scope was added here 
just for convenience in `TestRaftServer`. I could use the "controller" scope 
instead and remove this.




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