Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-28 Thread via GitHub


mimaison merged PR #16040:
URL: https://github.com/apache/kafka/pull/16040


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



Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-28 Thread via GitHub


OmniaGM commented on PR #16040:
URL: https://github.com/apache/kafka/pull/16040#issuecomment-2134991869

   Fixed now! 


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



Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-28 Thread via GitHub


OmniaGM commented on PR #16040:
URL: https://github.com/apache/kafka/pull/16040#issuecomment-2134979805

   > @OmniaGM It seems the conflicts are not fixed.
   
   this is a new one :D will fix this now


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



Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-28 Thread via GitHub


chia7712 commented on PR #16040:
URL: https://github.com/apache/kafka/pull/16040#issuecomment-2134977554

   @OmniaGM It seems the conflicts are not fixed.


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



Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-28 Thread via GitHub


mimaison commented on code in PR #16040:
URL: https://github.com/apache/kafka/pull/16040#discussion_r1617003681


##
server/src/main/java/org/apache/kafka/server/config/KafkaServerConfigs.java:
##
@@ -0,0 +1,139 @@
+/*
+ * 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.server.config;
+
+import org.apache.kafka.clients.CommonClientConfigs;
+import org.apache.kafka.common.config.TopicConfig;
+import org.apache.kafka.server.authorizer.Authorizer;
+public class KafkaServerConfigs {

Review Comment:
   I think we can drop the prefix and have shorter names. KafkaProducer uses 
ProducerConfig.



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



Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-28 Thread via GitHub


OmniaGM commented on code in PR #16040:
URL: https://github.com/apache/kafka/pull/16040#discussion_r1616995730


##
server/src/main/java/org/apache/kafka/server/config/KafkaServerConfigs.java:
##
@@ -0,0 +1,139 @@
+/*
+ * 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.server.config;
+
+import org.apache.kafka.clients.CommonClientConfigs;
+import org.apache.kafka.common.config.TopicConfig;
+import org.apache.kafka.server.authorizer.Authorizer;
+public class KafkaServerConfigs {

Review Comment:
   Not needed but we have already `KafkaServer` so I named it as 
`KafkaServerConfigs` to follow 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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-25 Thread via GitHub


mimaison commented on code in PR #16040:
URL: https://github.com/apache/kafka/pull/16040#discussion_r1614511230


##
server/src/main/java/org/apache/kafka/server/config/KafkaServerConfigs.java:
##
@@ -0,0 +1,139 @@
+/*
+ * 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.server.config;
+
+import org.apache.kafka.clients.CommonClientConfigs;
+import org.apache.kafka.common.config.TopicConfig;
+import org.apache.kafka.server.authorizer.Authorizer;
+public class KafkaServerConfigs {

Review Comment:
   Do we need the `Kafka` prefix? Could we name this file `ServerConfigs` or 
`BrokerConfigs`?



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



Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-23 Thread via GitHub


chia7712 commented on PR #16040:
URL: https://github.com/apache/kafka/pull/16040#issuecomment-2127817417

   ```
   > Task :core:compileTestScala
   [Error] 
/home/chia7712/project/kafka/core/src/test/scala/unit/kafka/server/LogDirFailureTest.scala:57:45:
 value ControlledShutdownEnableProp is not a member of object 
kafka.server.KafkaConfig
   one error found
   ```
   please fix the build error
   


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



Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-23 Thread via GitHub


OmniaGM commented on code in PR #16040:
URL: https://github.com/apache/kafka/pull/16040#discussion_r1611700378


##
server/src/main/java/org/apache/kafka/server/config/DelegationTokenManagerConfigs.java:
##
@@ -0,0 +1,40 @@
+/*
+ * 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.server.config;
+
+public class DelegationTokenManagerConfigs {
+/** * Delegation Token Configuration /
+public static final String DELEGATION_TOKEN_SECRET_KEY_CONFIG = 
"delegation.token.secret.key";
+public static final String DELEGATION_TOKEN_SECRET_KEY_DOC = "Secret key 
to generate and verify delegation tokens. The same key must be configured 
across all the brokers. " +
+" If using Kafka with KRaft, the key must also be set across all 
controllers. " +
+" If the key is not set or set to empty string, brokers will 
disable the delegation token support.";
+
+public static final String DELEGATION_TOKEN_SECRET_KEY_ALIAS_CONFIG = 
"delegation.token.master.key";
+public static final String DELEGATION_TOKEN_SECRET_KEY_ALIAS_DOC = 
"DEPRECATED: An alias for " + DELEGATION_TOKEN_SECRET_KEY_CONFIG + ", which 
should be used instead of this config.";
+
+public static final String DELEGATION_TOKEN_MAX_LIFETIME_CONFIG = 
"delegation.token.max.lifetime.ms";
+public static final long DELEGATION_TOKEN_MAX_LIFE_TIME_MS_DEFAULT = 7 * 
24 * 60 * 60 * 1000L;
+public static final String DELEGATION_TOKEN_MAX_LIFE_TIME_DOC = "The token 
has a maximum lifetime beyond which it cannot be renewed anymore. Default value 
7 days.";
+
+public static final String DELEGATION_TOKEN_EXPIRY_TIME_MS_CONFIG = 
"delegation.token.expiry.time.ms";
+public static final long DELEGATION_TOKEN_EXPIRY_TIME_MS_DEFAULT = 24 * 60 
* 60 * 1000L;
+public static final String DELEGATION_TOKEN_EXPIRY_TIME_MS_DOC = "The 
token validity time in milliseconds before the token needs to be renewed. 
Default value 1 day.";
+
+public static final String 
DELEGATION_TOKEN_EXPIRY_CHECK_INTERVAL_MS_CONFIG = 
"delegation.token.expiry.check.interval.ms";
+public static final long DELEGATION_TOKEN_EXPIRY_CHECK_INTERVAL_MS_DEFAULT 
= 1 * 60 * 60 * 1000L;

Review Comment:
   I think `1` was added originally to follow one of the config patterns like 
for configs like `DEFAULT_DELETE_RETENTION_MS` (24 * 60 * 60 * 1000L)  or 
`LOG_CLEANUP_INTERVAL_MS_DEFAULT`(5 * 60 * 1000). I removed it as there is no 
one pattern for representing unit of `1`. 



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



Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-23 Thread via GitHub


OmniaGM commented on code in PR #16040:
URL: https://github.com/apache/kafka/pull/16040#discussion_r1611702704


##
server/src/main/java/org/apache/kafka/server/config/KafkaServerConfigs.java:
##
@@ -0,0 +1,139 @@
+/*
+ * 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.server.config;
+
+import org.apache.kafka.clients.CommonClientConfigs;
+import org.apache.kafka.common.config.TopicConfig;
+import org.apache.kafka.server.authorizer.Authorizer;
+public class KafkaServerConfigs {
+/** * General Configuration ***/
+public static final String RESERVED_BROKER_MAX_ID_CONFIG = 
"reserved.broker.max.id";
+public static final int RESERVED_BROKER_MAX_ID_DEFAULT = 1000;
+public static final String RESERVED_BROKER_MAX_ID_DOC = "Max number that 
can be used for a broker.id";
+
+public static final String BROKER_ID_GENERATION_ENABLE_CONFIG = 
"broker.id.generation.enable";
+public static final boolean BROKER_ID_GENERATION_ENABLE_DEFAULT = true;
+public static final String BROKER_ID_GENERATION_ENABLE_DOC = "Enable 
automatic broker id generation on the server. When enabled the value configured 
for " + RESERVED_BROKER_MAX_ID_CONFIG + " should be reviewed.";
+
+
+public static final String BROKER_ID_CONFIG = "broker.id";
+public static final int BROKER_ID_DEFAULT = -1;
+public static final String BROKER_ID_DOC = "The broker id for this server. 
If unset, a unique broker id will be generated." +
+"To avoid conflicts between ZooKeeper generated broker id's and 
user configured broker id's, generated broker ids " +
+"start from " + RESERVED_BROKER_MAX_ID_CONFIG + " + 1.";
+
+public static final String MESSAGE_MAX_BYTES_CONFIG = "message.max.bytes";
+public static final String MESSAGE_MAX_BYTES_DOC = 
TopicConfig.MAX_MESSAGE_BYTES_DOC +
+"This can be set per topic with the topic level " + 
TopicConfig.MAX_MESSAGE_BYTES_CONFIG + " config.";
+
+public static final String NUM_NETWORK_THREADS_CONFIG = 
"num.network.threads";
+public static final int NUM_NETWORK_THREADS_DEFAULT = 3;
+public static final String NUM_NETWORK_THREADS_DOC = "The number of 
threads that the server uses for receiving requests from the network and 
sending responses to the network. Noted: each listener (except for controller 
listener) creates its own thread pool.";
+
+public static final String NUM_IO_THREADS_CONFIG = "num.io.threads";
+public static final int NUM_IO_THREADS_DEFAULT = 8;
+public static final String NUM_IO_THREADS_DOC = "The number of threads 
that the server uses for processing requests, which may include disk I/O";
+
+public static final String BACKGROUND_THREADS_CONFIG = 
"background.threads";
+public static final int BACKGROUND_THREADS_DEFAULT = 10;
+public static final String BACKGROUND_THREADS_DOC = "The number of threads 
to use for various background processing tasks";
+
+public static final String NUM_REPLICA_ALTER_LOG_DIRS_THREADS_CONFIG = 
"num.replica.alter.log.dirs.threads";
+public static final String NUM_REPLICA_ALTER_LOG_DIRS_THREADS_DOC = "The 
number of threads that can move replicas between log directories, which may 
include disk I/O";
+
+public static final String QUEUED_MAX_REQUESTS_CONFIG = 
"queued.max.requests";
+public static final int QUEUED_MAX_REQUESTS_DEFAULT = 500;
+public static final String QUEUED_MAX_REQUESTS_DOC = "The number of queued 
requests allowed for data-plane, before blocking the network threads";
+
+public static final String QUEUED_MAX_BYTES_CONFIG = 
"queued.max.request.bytes";
+public static final int QUEUED_MAX_REQUEST_BYTES_DEFAULT = -1;
+public static final String QUEUED_MAX_REQUEST_BYTES_DOC = "The number of 
queued bytes allowed before no more requests are read";
+
+public static final String REQUEST_TIMEOUT_MS_CONFIG = 
CommonClientConfigs.REQUEST_TIMEOUT_MS_CONFIG;
+public static final int REQUEST_TIMEOUT_MS_DEFAULT = 3;
+public static final String REQUEST_TIMEOUT_MS_DOC = 
CommonClientConfigs.REQUEST_TIMEOUT_MS_DOC;
+
+public static final String SOCKET_CONNECTION_SETUP_TIMEOUT_MS_CONFIG = 

Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-23 Thread via GitHub


OmniaGM commented on code in PR #16040:
URL: https://github.com/apache/kafka/pull/16040#discussion_r1611702322


##
core/src/main/scala/kafka/server/KafkaConfig.scala:
##
@@ -1519,7 +1411,7 @@ class KafkaConfig private(doLog: Boolean, val props: 
java.util.Map[_, _], dynami
 require(!interBrokerUsesSasl || 
saslEnabledMechanisms(interBrokerListenerName).contains(saslMechanismInterBrokerProtocol),
   s"${KafkaSecurityConfigs.SASL_MECHANISM_INTER_BROKER_PROTOCOL_CONFIG} 
must be included in ${KafkaSecurityConfigs.SASL_ENABLED_MECHANISMS_CONFIG} when 
SASL is used for inter-broker communication")
 require(queuedMaxBytes <= 0 || queuedMaxBytes >= socketRequestMaxBytes,
-  s"${KafkaConfig.QueuedMaxBytesProp} must be larger or equal to 
${SocketServerConfigs.SOCKET_RECEIVE_BUFFER_BYTES_CONFIG}")
+  s"${KafkaServerConfigs.QUEUED_MAX_BYTES_CONFIG} must be larger or equal 
to ${SocketServerConfigs.SOCKET_RECEIVE_BUFFER_BYTES_CONFIG}")

Review Comment:
   Nice catch, I just translated this part and didn't think of rechecking it. 



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



Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-23 Thread via GitHub


OmniaGM commented on code in PR #16040:
URL: https://github.com/apache/kafka/pull/16040#discussion_r1611701516


##
server/src/main/java/org/apache/kafka/server/config/DelegationTokenManagerConfigs.java:
##
@@ -0,0 +1,40 @@
+/*
+ * 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.server.config;
+
+public class DelegationTokenManagerConfigs {
+/** * Delegation Token Configuration /
+public static final String DELEGATION_TOKEN_SECRET_KEY_CONFIG = 
"delegation.token.secret.key";
+public static final String DELEGATION_TOKEN_SECRET_KEY_DOC = "Secret key 
to generate and verify delegation tokens. The same key must be configured 
across all the brokers. " +
+" If using Kafka with KRaft, the key must also be set across all 
controllers. " +
+" If the key is not set or set to empty string, brokers will 
disable the delegation token support.";
+
+public static final String DELEGATION_TOKEN_SECRET_KEY_ALIAS_CONFIG = 
"delegation.token.master.key";

Review Comment:
   Marked it as deprecated as the doc has been indicating it is deprecated for 
long time



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



Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-23 Thread via GitHub


OmniaGM commented on code in PR #16040:
URL: https://github.com/apache/kafka/pull/16040#discussion_r1611700378


##
server/src/main/java/org/apache/kafka/server/config/DelegationTokenManagerConfigs.java:
##
@@ -0,0 +1,40 @@
+/*
+ * 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.server.config;
+
+public class DelegationTokenManagerConfigs {
+/** * Delegation Token Configuration /
+public static final String DELEGATION_TOKEN_SECRET_KEY_CONFIG = 
"delegation.token.secret.key";
+public static final String DELEGATION_TOKEN_SECRET_KEY_DOC = "Secret key 
to generate and verify delegation tokens. The same key must be configured 
across all the brokers. " +
+" If using Kafka with KRaft, the key must also be set across all 
controllers. " +
+" If the key is not set or set to empty string, brokers will 
disable the delegation token support.";
+
+public static final String DELEGATION_TOKEN_SECRET_KEY_ALIAS_CONFIG = 
"delegation.token.master.key";
+public static final String DELEGATION_TOKEN_SECRET_KEY_ALIAS_DOC = 
"DEPRECATED: An alias for " + DELEGATION_TOKEN_SECRET_KEY_CONFIG + ", which 
should be used instead of this config.";
+
+public static final String DELEGATION_TOKEN_MAX_LIFETIME_CONFIG = 
"delegation.token.max.lifetime.ms";
+public static final long DELEGATION_TOKEN_MAX_LIFE_TIME_MS_DEFAULT = 7 * 
24 * 60 * 60 * 1000L;
+public static final String DELEGATION_TOKEN_MAX_LIFE_TIME_DOC = "The token 
has a maximum lifetime beyond which it cannot be renewed anymore. Default value 
7 days.";
+
+public static final String DELEGATION_TOKEN_EXPIRY_TIME_MS_CONFIG = 
"delegation.token.expiry.time.ms";
+public static final long DELEGATION_TOKEN_EXPIRY_TIME_MS_DEFAULT = 24 * 60 
* 60 * 1000L;
+public static final String DELEGATION_TOKEN_EXPIRY_TIME_MS_DOC = "The 
token validity time in milliseconds before the token needs to be renewed. 
Default value 1 day.";
+
+public static final String 
DELEGATION_TOKEN_EXPIRY_CHECK_INTERVAL_MS_CONFIG = 
"delegation.token.expiry.check.interval.ms";
+public static final long DELEGATION_TOKEN_EXPIRY_CHECK_INTERVAL_MS_DEFAULT 
= 1 * 60 * 60 * 1000L;

Review Comment:
   I think `1` was added originally to follow rest of the config patterns like 
`DEFAULT_DELETE_RETENTION_MS` (24 * 60 * 60 * 1000L)  or 
`LOG_CLEANUP_INTERVAL_MS_DEFAULT`(5 * 60 * 1000). I removed it as there is no 
one pattern for representing unit of `1`. 



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



Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-23 Thread via GitHub


chia7712 commented on code in PR #16040:
URL: https://github.com/apache/kafka/pull/16040#discussion_r1611583091


##
server/src/main/java/org/apache/kafka/server/config/DelegationTokenManagerConfigs.java:
##
@@ -0,0 +1,40 @@
+/*
+ * 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.server.config;
+
+public class DelegationTokenManagerConfigs {
+/** * Delegation Token Configuration /
+public static final String DELEGATION_TOKEN_SECRET_KEY_CONFIG = 
"delegation.token.secret.key";
+public static final String DELEGATION_TOKEN_SECRET_KEY_DOC = "Secret key 
to generate and verify delegation tokens. The same key must be configured 
across all the brokers. " +
+" If using Kafka with KRaft, the key must also be set across all 
controllers. " +
+" If the key is not set or set to empty string, brokers will 
disable the delegation token support.";
+
+public static final String DELEGATION_TOKEN_SECRET_KEY_ALIAS_CONFIG = 
"delegation.token.master.key";
+public static final String DELEGATION_TOKEN_SECRET_KEY_ALIAS_DOC = 
"DEPRECATED: An alias for " + DELEGATION_TOKEN_SECRET_KEY_CONFIG + ", which 
should be used instead of this config.";
+
+public static final String DELEGATION_TOKEN_MAX_LIFETIME_CONFIG = 
"delegation.token.max.lifetime.ms";
+public static final long DELEGATION_TOKEN_MAX_LIFE_TIME_MS_DEFAULT = 7 * 
24 * 60 * 60 * 1000L;
+public static final String DELEGATION_TOKEN_MAX_LIFE_TIME_DOC = "The token 
has a maximum lifetime beyond which it cannot be renewed anymore. Default value 
7 days.";
+
+public static final String DELEGATION_TOKEN_EXPIRY_TIME_MS_CONFIG = 
"delegation.token.expiry.time.ms";
+public static final long DELEGATION_TOKEN_EXPIRY_TIME_MS_DEFAULT = 24 * 60 
* 60 * 1000L;
+public static final String DELEGATION_TOKEN_EXPIRY_TIME_MS_DOC = "The 
token validity time in milliseconds before the token needs to be renewed. 
Default value 1 day.";
+
+public static final String 
DELEGATION_TOKEN_EXPIRY_CHECK_INTERVAL_MS_CONFIG = 
"delegation.token.expiry.check.interval.ms";
+public static final long DELEGATION_TOKEN_EXPIRY_CHECK_INTERVAL_MS_DEFAULT 
= 1 * 60 * 60 * 1000L;

Review Comment:
   `1 * 60 * 60 * 1000L;` -> `60 * 60 * 1000L;`



##
core/src/main/scala/kafka/server/KafkaConfig.scala:
##
@@ -1519,7 +1411,7 @@ class KafkaConfig private(doLog: Boolean, val props: 
java.util.Map[_, _], dynami
 require(!interBrokerUsesSasl || 
saslEnabledMechanisms(interBrokerListenerName).contains(saslMechanismInterBrokerProtocol),
   s"${KafkaSecurityConfigs.SASL_MECHANISM_INTER_BROKER_PROTOCOL_CONFIG} 
must be included in ${KafkaSecurityConfigs.SASL_ENABLED_MECHANISMS_CONFIG} when 
SASL is used for inter-broker communication")
 require(queuedMaxBytes <= 0 || queuedMaxBytes >= socketRequestMaxBytes,
-  s"${KafkaConfig.QueuedMaxBytesProp} must be larger or equal to 
${SocketServerConfigs.SOCKET_RECEIVE_BUFFER_BYTES_CONFIG}")
+  s"${KafkaServerConfigs.QUEUED_MAX_BYTES_CONFIG} must be larger or equal 
to ${SocketServerConfigs.SOCKET_RECEIVE_BUFFER_BYTES_CONFIG}")

Review Comment:
   This is unrelated to this PR, but could you please change 
`SOCKET_RECEIVE_BUFFER_BYTES_CONFIG` to `SOCKET_REQUEST_MAX_BYTES_CONFIG`?



##
server/src/main/java/org/apache/kafka/server/config/DelegationTokenManagerConfigs.java:
##
@@ -0,0 +1,40 @@
+/*
+ * 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

Re: [PR] KAFKA-15853: Move general configs out of KafkaConfig [kafka]

2024-05-23 Thread via GitHub


OmniaGM commented on PR #16040:
URL: https://github.com/apache/kafka/pull/16040#issuecomment-2126904561

   @nizhikov can you have a look please when you have time? There are only 2 
PRs left for this work one to move `configDef` and then the final one will be 
to move `KafkaConfig` class 


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