You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/02/08 23:12:22 UTC

[GitHub] [kafka] cmccabe commented on a change in pull request #10066: KAFKA-12278; Ensure exposed api versions are consistent within listener scopes

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



##########
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:
       @ijuma : unfortunately we don't have a clear separation between clients and brokers at the protocol level.  As you know, if a random node connects to the broker and asks for ApiVersions, the broker doesn't (yet) know if the other node is another broker or if it's a client.  So it wouldn't help to label APIs as CLIENT vs. BROKER, since the broker has to send back both anyway.
   
   On the other hand, we can definitely put APIs into "zk broker", "kip-500 zk", and "kip500 controller" and use those buckets to figure out what to send in the ApiVersionsRequest.
   
   @hachikuji : The "raft" scope seems a little weird since all the other scopes map to listeners on servers.  The TestRaftServer is just an internal junit thing, right?  So it's probably fine if it just uses the Controller scope and returns `UnsupportedVersionException` for things it doesn't support.  I don't think we should have a separate scope for this unless it somehow impacts the real servers.




----------------------------------------------------------------
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:
users@infra.apache.org