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/01/14 03:23:47 UTC
[GitHub] [kafka] hachikuji opened a new pull request #9883: MINOR: Generalize server startup to make way for KIP-500
hachikuji opened a new pull request #9883:
URL: https://github.com/apache/kafka/pull/9883
This patch attempts to generalize server initialization for KIP-500. It adds a `Server` trait which `KafkaServer` extends for the legacy Zookeeper server, and a new `KafkaRaftServer` for the new server. I have also added stubs for `KafkaRaftBroker` and `KafkaRaftController` to give a clearer idea how this will be used.
This patch attempts to be non-intrusive, but it's worth pointing out that it does away with `KafkaServerStartable`. I believe this was intended to support custom startup logic, but it is not an official API and we do not plan to support it after KIP-500.
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
----------------------------------------------------------------
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
[GitHub] [kafka] hachikuji commented on a change in pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
hachikuji commented on a change in pull request #9883:
URL: https://github.com/apache/kafka/pull/9883#discussion_r557077826
##########
File path: core/src/main/scala/kafka/raft/RaftManager.scala
##########
@@ -95,15 +95,15 @@ trait RaftManager[T] {
}
class KafkaRaftManager[T](
- nodeId: Int,
- baseLogDir: String,
recordSerde: RecordSerde[T],
topicPartition: TopicPartition,
config: KafkaConfig,
time: Time,
metrics: Metrics
) extends RaftManager[T] with Logging {
+ private val nodeId = config.brokerId
+ private val baseLogDir = config.logDirs.head
Review comment:
Right. There are a few placeholders in here until we get all of the configs in.
----------------------------------------------------------------
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
[GitHub] [kafka] hachikuji commented on a change in pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
hachikuji commented on a change in pull request #9883:
URL: https://github.com/apache/kafka/pull/9883#discussion_r557622659
##########
File path: core/src/main/scala/kafka/server/KafkaRaftController.scala
##########
@@ -0,0 +1,23 @@
+/*
+ * 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 kafka.server
+
+class KafkaRaftController {
Review comment:
Decided to go with `ControllerServer` and `BrokerServer`. As Colin mentioned offline, the "server" suffix is helpful conveying that this component is responsible for starting sockets and such. This distinguishes `ControllerServer` from the actual implementation of the controller logic.
----------------------------------------------------------------
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
[GitHub] [kafka] hachikuji commented on a change in pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
hachikuji commented on a change in pull request #9883:
URL: https://github.com/apache/kafka/pull/9883#discussion_r557063780
##########
File path: core/src/main/scala/kafka/server/KafkaRaftController.scala
##########
@@ -0,0 +1,23 @@
+/*
+ * 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 kafka.server
+
+class KafkaRaftController {
Review comment:
Hmm, I found it a little strange if "Raft" is the only prefix. The `RaftController` is not controlling Raft... I've considered calling it `MetadataController` previously. To go along with that, we could have `DataBroker` or just `Broker`.
----------------------------------------------------------------
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
[GitHub] [kafka] ijuma commented on a change in pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #9883:
URL: https://github.com/apache/kafka/pull/9883#discussion_r557058822
##########
File path: core/src/main/scala/kafka/server/KafkaRaftBroker.scala
##########
@@ -0,0 +1,23 @@
+/*
+ * 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 kafka.server
+
+class KafkaRaftBroker {
Review comment:
Maybe we can add a brief comment explaining that this is a stub and not used yet. Similar for KafkaRaftController.
##########
File path: clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
##########
@@ -404,13 +404,47 @@ public ConfigDef define(String name, Type type, Importance importance, String do
* @param name The name of the config parameter
* @param type The type of the config
* @param defaultValue The default value to use if this config isn't present
- * @param importance
+ * @param importance The importance of this config (i.e. is this something you will likely need to change?)
* @return This ConfigDef so you can chain calls
*/
public ConfigDef defineInternal(final String name, final Type type, final Object defaultValue, final Importance importance) {
return define(new ConfigKey(name, type, defaultValue, null, importance, "", "", -1, Width.NONE, name, Collections.<String>emptyList(), null, true));
}
+ /**
+ * Define a new internal configuration. Internal configuration won't show up in the docs and aren't
+ * intended for general use.
+ * @param name The name of the config parameter
+ * @param type The type of the config
+ * @param defaultValue The default value to use if this config isn't present
+ * @param validator the validator to use in checking the correctness of the config
+ * @param importance The importance of this config (i.e. is this something you will likely need to change?)
+ * @return This ConfigDef so you can chain calls
+ */
+ public ConfigDef defineInternal(
+ final String name,
+ final Type type,
+ final Object defaultValue,
+ final Validator validator,
+ final Importance importance
+ ) {
+ return define(new ConfigKey(
+ name,
+ type,
+ defaultValue,
+ validator,
+ importance,
+ "",
+ "",
+ -1,
+ Width.NONE,
+ name,
+ Collections.<String>emptyList(),
+ null,
+ true
+ ));
+ }
Review comment:
Nit: it looks pretty odd to have widely differing code styles in the same file.
##########
File path: core/src/main/scala/kafka/server/KafkaRaftController.scala
##########
@@ -0,0 +1,23 @@
+/*
+ * 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 kafka.server
+
+class KafkaRaftController {
Review comment:
Do you think the `Kafka` prefix adds much value? Would `RaftController`, `RaftBroker` and `RaftServer` be confusing/less clear?
##########
File path: core/src/main/scala/kafka/server/KafkaConfig.scala
##########
@@ -1453,6 +1456,21 @@ class KafkaConfig(val props: java.util.Map[_, _], doLog: Boolean, dynamicConfigO
val brokerIdGenerationEnable: Boolean = getBoolean(KafkaConfig.BrokerIdGenerationEnableProp)
val maxReservedBrokerId: Int = getInt(KafkaConfig.MaxReservedBrokerIdProp)
var brokerId: Int = getInt(KafkaConfig.BrokerIdProp)
+ val processRoles = parseProcessRoles()
+
+ private def parseProcessRoles(): Set[ProcessRole] = {
+ val roles = getList(KafkaConfig.ProcessRolesProp).asScala.map {
+ case "broker" => BrokerRole
+ case "controller" => ControllerRole
+ case role => throw new ConfigException(s"Unknown process role $role")
+ }
+
+ if (roles.distinct.length != roles.size) {
Review comment:
This duplicates the work done in `roles.toSet`, seems like we can assign that to a variable to avoid that.
----------------------------------------------------------------
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
[GitHub] [kafka] hachikuji merged pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
hachikuji merged pull request #9883:
URL: https://github.com/apache/kafka/pull/9883
----------------------------------------------------------------
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
[GitHub] [kafka] ijuma commented on a change in pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #9883:
URL: https://github.com/apache/kafka/pull/9883#discussion_r557068166
##########
File path: core/src/main/scala/kafka/server/KafkaRaftController.scala
##########
@@ -0,0 +1,23 @@
+/*
+ * 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 kafka.server
+
+class KafkaRaftController {
Review comment:
Yeah, I agree that it reads a bit strange without the `Kafka` prefix. I think what you have in the PR is fine.
----------------------------------------------------------------
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
[GitHub] [kafka] cmccabe commented on pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
cmccabe commented on pull request #9883:
URL: https://github.com/apache/kafka/pull/9883#issuecomment-761195905
LGTM. I had one small comment.
Thanks, @hachikuji
----------------------------------------------------------------
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
[GitHub] [kafka] cmccabe commented on a change in pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
cmccabe commented on a change in pull request #9883:
URL: https://github.com/apache/kafka/pull/9883#discussion_r557799746
##########
File path: core/src/main/scala/kafka/server/KafkaRaftServer.scala
##########
@@ -0,0 +1,98 @@
+/*
+ * 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 kafka.server
+
+import kafka.metrics.{KafkaMetricsReporter, KafkaYammerMetrics}
+import kafka.raft.KafkaRaftManager
+import kafka.server.KafkaRaftServer.{BrokerRole, ControllerRole}
+import kafka.utils.{CoreUtils, Logging, Mx4jLoader, VerifiableProperties}
+import org.apache.kafka.common.TopicPartition
+import org.apache.kafka.common.utils.{AppInfoParser, Time}
+import org.apache.kafka.raft.internals.StringSerde
+
+/**
+ * Partially stubbed implementation of the KIP-500 server which relies on a self-managed
+ * Raft quorum for replication of the `@metadata` topic, which stores all of
+ * the cluster metadata.
+ */
+class KafkaRaftServer(
Review comment:
Can we have a comment at least describing the fact that it can contain either a controller, broker, or both
----------------------------------------------------------------
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
[GitHub] [kafka] cmccabe commented on a change in pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
cmccabe commented on a change in pull request #9883:
URL: https://github.com/apache/kafka/pull/9883#discussion_r557072751
##########
File path: core/src/main/scala/kafka/server/KafkaRaftController.scala
##########
@@ -0,0 +1,23 @@
+/*
+ * 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 kafka.server
+
+class KafkaRaftController {
Review comment:
How about RaftBrokerServer and ControllerServer? That would help differentiate this from the Controller / QuorumController classes. It would also be consistent with KafkaServer.
I think it's also more accurate-- these classes manage "all the server stuff" including socket server, etc.
----------------------------------------------------------------
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
[GitHub] [kafka] hachikuji commented on a change in pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
hachikuji commented on a change in pull request #9883:
URL: https://github.com/apache/kafka/pull/9883#discussion_r557078335
##########
File path: core/src/main/scala/kafka/server/KafkaRaftController.scala
##########
@@ -0,0 +1,23 @@
+/*
+ * 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 kafka.server
+
+class KafkaRaftController {
Review comment:
Or maybe just `Controller` and `Broker`?
----------------------------------------------------------------
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
[GitHub] [kafka] hachikuji commented on a change in pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
hachikuji commented on a change in pull request #9883:
URL: https://github.com/apache/kafka/pull/9883#discussion_r557064046
##########
File path: clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
##########
@@ -404,13 +404,47 @@ public ConfigDef define(String name, Type type, Importance importance, String do
* @param name The name of the config parameter
* @param type The type of the config
* @param defaultValue The default value to use if this config isn't present
- * @param importance
+ * @param importance The importance of this config (i.e. is this something you will likely need to change?)
* @return This ConfigDef so you can chain calls
*/
public ConfigDef defineInternal(final String name, final Type type, final Object defaultValue, final Importance importance) {
return define(new ConfigKey(name, type, defaultValue, null, importance, "", "", -1, Width.NONE, name, Collections.<String>emptyList(), null, true));
}
+ /**
+ * Define a new internal configuration. Internal configuration won't show up in the docs and aren't
+ * intended for general use.
+ * @param name The name of the config parameter
+ * @param type The type of the config
+ * @param defaultValue The default value to use if this config isn't present
+ * @param validator the validator to use in checking the correctness of the config
+ * @param importance The importance of this config (i.e. is this something you will likely need to change?)
+ * @return This ConfigDef so you can chain calls
+ */
+ public ConfigDef defineInternal(
+ final String name,
+ final Type type,
+ final Object defaultValue,
+ final Validator validator,
+ final Importance importance
+ ) {
+ return define(new ConfigKey(
+ name,
+ type,
+ defaultValue,
+ validator,
+ importance,
+ "",
+ "",
+ -1,
+ Width.NONE,
+ name,
+ Collections.<String>emptyList(),
+ null,
+ true
+ ));
+ }
Review comment:
Fair enough, I'll conform. I just find the other style hard to read.
----------------------------------------------------------------
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
[GitHub] [kafka] hachikuji commented on a change in pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
hachikuji commented on a change in pull request #9883:
URL: https://github.com/apache/kafka/pull/9883#discussion_r557807090
##########
File path: core/src/main/scala/kafka/server/KafkaRaftServer.scala
##########
@@ -0,0 +1,98 @@
+/*
+ * 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 kafka.server
+
+import kafka.metrics.{KafkaMetricsReporter, KafkaYammerMetrics}
+import kafka.raft.KafkaRaftManager
+import kafka.server.KafkaRaftServer.{BrokerRole, ControllerRole}
+import kafka.utils.{CoreUtils, Logging, Mx4jLoader, VerifiableProperties}
+import org.apache.kafka.common.TopicPartition
+import org.apache.kafka.common.utils.{AppInfoParser, Time}
+import org.apache.kafka.raft.internals.StringSerde
+
+/**
+ * Partially stubbed implementation of the KIP-500 server which relies on a self-managed
+ * Raft quorum for replication of the `@metadata` topic, which stores all of
+ * the cluster metadata.
+ */
+class KafkaRaftServer(
Review comment:
Makes sense. Added a comment above.
----------------------------------------------------------------
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
[GitHub] [kafka] cmccabe commented on a change in pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
cmccabe commented on a change in pull request #9883:
URL: https://github.com/apache/kafka/pull/9883#discussion_r557070495
##########
File path: core/src/main/scala/kafka/raft/RaftManager.scala
##########
@@ -95,15 +95,15 @@ trait RaftManager[T] {
}
class KafkaRaftManager[T](
- nodeId: Int,
- baseLogDir: String,
recordSerde: RecordSerde[T],
topicPartition: TopicPartition,
config: KafkaConfig,
time: Time,
metrics: Metrics
) extends RaftManager[T] with Logging {
+ private val nodeId = config.brokerId
+ private val baseLogDir = config.logDirs.head
Review comment:
this isn't quite correct since we could also have a specifically configured metadata.log.dir
----------------------------------------------------------------
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
[GitHub] [kafka] hachikuji commented on a change in pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
hachikuji commented on a change in pull request #9883:
URL: https://github.com/apache/kafka/pull/9883#discussion_r557063780
##########
File path: core/src/main/scala/kafka/server/KafkaRaftController.scala
##########
@@ -0,0 +1,23 @@
+/*
+ * 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 kafka.server
+
+class KafkaRaftController {
Review comment:
Hmm, I found it a little strange if "Raft" is the only prefix. The `RaftController` is not controller Raft... I've considered calling it `MetadataController` previously. To go along with that, we could have `DataBroker` or just `Broker`.
----------------------------------------------------------------
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
[GitHub] [kafka] cmccabe commented on a change in pull request #9883: MINOR: Generalize server startup to make way for KIP-500
Posted by GitBox <gi...@apache.org>.
cmccabe commented on a change in pull request #9883:
URL: https://github.com/apache/kafka/pull/9883#discussion_r558590756
##########
File path: core/src/main/scala/kafka/server/KafkaConfig.scala
##########
@@ -1453,6 +1456,23 @@ class KafkaConfig(val props: java.util.Map[_, _], doLog: Boolean, dynamicConfigO
val brokerIdGenerationEnable: Boolean = getBoolean(KafkaConfig.BrokerIdGenerationEnableProp)
val maxReservedBrokerId: Int = getInt(KafkaConfig.MaxReservedBrokerIdProp)
var brokerId: Int = getInt(KafkaConfig.BrokerIdProp)
+ val processRoles = parseProcessRoles()
+
+ private def parseProcessRoles(): Set[ProcessRole] = {
+ val roles = getList(KafkaConfig.ProcessRolesProp).asScala.map {
+ case "broker" => BrokerRole
+ case "controller" => ControllerRole
+ case role => throw new ConfigException(s"Unknown process role $role")
Review comment:
can you list the valid roles in this exception?
----------------------------------------------------------------
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