chia7712 commented on a change in pull request #10589: URL: https://github.com/apache/kafka/pull/10589#discussion_r624942991
########## File path: clients/src/main/java/org/apache/kafka/common/config/TopicConfig.java ########## @@ -166,19 +191,36 @@ "they will receive messages with a format that they don't understand."; public static final String MESSAGE_TIMESTAMP_TYPE_CONFIG = "message.timestamp.type"; + public static final String MESSAGE_TIMESTAMP_TYPE_DEFAULT = "CreateTime"; public static final String MESSAGE_TIMESTAMP_TYPE_DOC = "Define whether the timestamp in the message is " + "message create time or log append time. The value should be either `CreateTime` or `LogAppendTime`"; public static final String MESSAGE_TIMESTAMP_DIFFERENCE_MAX_MS_CONFIG = "message.timestamp.difference.max.ms"; + public static final long MESSAGE_TIMESTAMP_DIFFERENCE_MAX_MS_DEFAULT = Long.MAX_VALUE; public static final String MESSAGE_TIMESTAMP_DIFFERENCE_MAX_MS_DOC = "The maximum difference allowed between " + "the timestamp when a broker receives a message and the timestamp specified in the message. If " + "message.timestamp.type=CreateTime, a message will be rejected if the difference in timestamp " + "exceeds this threshold. This configuration is ignored if message.timestamp.type=LogAppendTime."; public static final String MESSAGE_DOWNCONVERSION_ENABLE_CONFIG = "message.downconversion.enable"; + public static final boolean MESSAGE_DOWNCONVERSION_ENABLE_DEFAULT = true; public static final String MESSAGE_DOWNCONVERSION_ENABLE_DOC = "This configuration controls whether " + "down-conversion of message formats is enabled to satisfy consume requests. When set to <code>false</code>, " + "broker will not perform down-conversion for consumers expecting an older message format. The broker responds " + "with <code>UNSUPPORTED_VERSION</code> error for consume requests from such older clients. This configuration" + "does not apply to any message format conversion that might be required for replication to followers."; + + public static final String LEADER_REPLICATION_THROTTLED_REPLICAS = "leader.replication.throttled.replicas"; Review comment: https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/log/LogConfig.scala#L149 can reference to this field ########## File path: clients/src/main/java/org/apache/kafka/common/config/TopicConfig.java ########## @@ -166,19 +191,36 @@ "they will receive messages with a format that they don't understand."; public static final String MESSAGE_TIMESTAMP_TYPE_CONFIG = "message.timestamp.type"; + public static final String MESSAGE_TIMESTAMP_TYPE_DEFAULT = "CreateTime"; public static final String MESSAGE_TIMESTAMP_TYPE_DOC = "Define whether the timestamp in the message is " + "message create time or log append time. The value should be either `CreateTime` or `LogAppendTime`"; public static final String MESSAGE_TIMESTAMP_DIFFERENCE_MAX_MS_CONFIG = "message.timestamp.difference.max.ms"; + public static final long MESSAGE_TIMESTAMP_DIFFERENCE_MAX_MS_DEFAULT = Long.MAX_VALUE; public static final String MESSAGE_TIMESTAMP_DIFFERENCE_MAX_MS_DOC = "The maximum difference allowed between " + "the timestamp when a broker receives a message and the timestamp specified in the message. If " + "message.timestamp.type=CreateTime, a message will be rejected if the difference in timestamp " + "exceeds this threshold. This configuration is ignored if message.timestamp.type=LogAppendTime."; public static final String MESSAGE_DOWNCONVERSION_ENABLE_CONFIG = "message.downconversion.enable"; + public static final boolean MESSAGE_DOWNCONVERSION_ENABLE_DEFAULT = true; public static final String MESSAGE_DOWNCONVERSION_ENABLE_DOC = "This configuration controls whether " + "down-conversion of message formats is enabled to satisfy consume requests. When set to <code>false</code>, " + "broker will not perform down-conversion for consumers expecting an older message format. The broker responds " + "with <code>UNSUPPORTED_VERSION</code> error for consume requests from such older clients. This configuration" + "does not apply to any message format conversion that might be required for replication to followers."; + + public static final String LEADER_REPLICATION_THROTTLED_REPLICAS = "leader.replication.throttled.replicas"; + public static final Collection<String> LEADER_REPLICATION_THROTTLED_REPLICAS_DEFAULT = Collections.emptyList(); + public static final String LEADER_REPLICATION_THROTTLED_REPLICAS_DOC = "A list of replicas for which log " + + "replication should be throttled on the leader side. The list should describe a set of replicas in the form " + + "[PartitionId]:[BrokerId],[PartitionId]:[BrokerId]:... or alternatively the wildcard '*' can be used to throttle " + + "all replicas for this topic."; + + public static final String FOLLOW_REPLICATION_THROTTLED_REPLICAS = "follower.replication.throttled.replicas"; Review comment: https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/log/LogConfig.scala#L150 can reference to this new field. ########## File path: clients/src/main/java/org/apache/kafka/common/config/TopicConfig.java ########## @@ -85,31 +99,37 @@ "limit only applies to a single record in that case."; public static final String INDEX_INTERVAL_BYTES_CONFIG = "index.interval.bytes"; - public static final String INDEX_INTERVAL_BYTES_DOCS = "This setting controls how frequently " + + public static final int INDEX_INTERVAL_BYTES_DEFAULT = 4096; + public static final String INDEX_INTERVAL_BYTES_DOC = "This setting controls how frequently " + Review comment: I want to see this change gets merged since I love consistency. However, this change may break the compatibility as this field is public. ########## File path: clients/src/main/java/org/apache/kafka/common/config/TopicConfig.java ########## @@ -125,18 +145,21 @@ public static final String CLEANUP_POLICY_CONFIG = "cleanup.policy"; public static final String CLEANUP_POLICY_COMPACT = "compact"; public static final String CLEANUP_POLICY_DELETE = "delete"; + public static final String CLEANUP_POLICY_DEFAULT = CLEANUP_POLICY_DELETE; public static final String CLEANUP_POLICY_DOC = "A string that is either \"" + CLEANUP_POLICY_DELETE + "\" or \"" + CLEANUP_POLICY_COMPACT + "\" or both. This string designates the retention policy to use on " + "old log segments. The default policy (\"delete\") will discard old segments when their retention " + Review comment: How about replacing `\"delete\"` by `CLEANUP_POLICY_DEFAULT`? ########## File path: clients/src/main/java/org/apache/kafka/common/config/TopicConfig.java ########## @@ -166,19 +191,36 @@ "they will receive messages with a format that they don't understand."; public static final String MESSAGE_TIMESTAMP_TYPE_CONFIG = "message.timestamp.type"; + public static final String MESSAGE_TIMESTAMP_TYPE_DEFAULT = "CreateTime"; public static final String MESSAGE_TIMESTAMP_TYPE_DOC = "Define whether the timestamp in the message is " + "message create time or log append time. The value should be either `CreateTime` or `LogAppendTime`"; public static final String MESSAGE_TIMESTAMP_DIFFERENCE_MAX_MS_CONFIG = "message.timestamp.difference.max.ms"; + public static final long MESSAGE_TIMESTAMP_DIFFERENCE_MAX_MS_DEFAULT = Long.MAX_VALUE; public static final String MESSAGE_TIMESTAMP_DIFFERENCE_MAX_MS_DOC = "The maximum difference allowed between " + "the timestamp when a broker receives a message and the timestamp specified in the message. If " + "message.timestamp.type=CreateTime, a message will be rejected if the difference in timestamp " + "exceeds this threshold. This configuration is ignored if message.timestamp.type=LogAppendTime."; public static final String MESSAGE_DOWNCONVERSION_ENABLE_CONFIG = "message.downconversion.enable"; + public static final boolean MESSAGE_DOWNCONVERSION_ENABLE_DEFAULT = true; public static final String MESSAGE_DOWNCONVERSION_ENABLE_DOC = "This configuration controls whether " + "down-conversion of message formats is enabled to satisfy consume requests. When set to <code>false</code>, " + "broker will not perform down-conversion for consumers expecting an older message format. The broker responds " + "with <code>UNSUPPORTED_VERSION</code> error for consume requests from such older clients. This configuration" + "does not apply to any message format conversion that might be required for replication to followers."; + + public static final String LEADER_REPLICATION_THROTTLED_REPLICAS = "leader.replication.throttled.replicas"; + public static final Collection<String> LEADER_REPLICATION_THROTTLED_REPLICAS_DEFAULT = Collections.emptyList(); Review comment: The origin type is `List` rather than `Collection`. Is this change intentional? -- 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