OmniaGM commented on code in PR #15684: URL: https://github.com/apache/kafka/pull/15684#discussion_r1556490595
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/OffsetConfig.java: ########## @@ -20,16 +20,53 @@ import org.apache.kafka.common.record.CompressionType; public class OffsetConfig { - public static final int DEFAULT_MAX_METADATA_SIZE = 4096; - public static final int DEFAULT_LOAD_BUFFER_SIZE = 5 * 1024 * 1024; - public static final long DEFAULT_OFFSET_RETENTION_MS = 24 * 60 * 60 * 1000L; - public static final long DEFAULT_OFFSETS_RETENTION_CHECK_INTERVAL_MS = 600000L; - public static final int DEFAULT_OFFSETS_TOPIC_NUM_PARTITIONS = 50; - public static final int DEFAULT_OFFSETS_TOPIC_SEGMENT_BYTES = 100 * 1024 * 1024; - public static final short DEFAULT_OFFSETS_TOPIC_REPLICATION_FACTOR = 3; - public static final CompressionType DEFAULT_OFFSETS_TOPIC_COMPRESSION_TYPE = CompressionType.NONE; - public static final int DEFAULT_OFFSET_COMMIT_TIMEOUT_MS = 5000; - public static final short DEFAULT_OFFSET_COMMIT_REQUIRED_ACKS = -1; + public static final String OFFSET_METADATA_MAX_SIZE_CONFIG = "offset.metadata.max.bytes"; + public static final int OFFSET_METADATA_MAX_SIZE_DEFAULT = 4096; + public static final String OFFSET_METADATA_MAX_SIZE_DOC = "The maximum size for a metadata entry associated with an offset commit."; + + public static final String OFFSETS_LOAD_BUFFER_SIZE_CONFIG = "offsets.load.buffer.size"; + public static final int OFFSETS_LOAD_BUFFER_SIZE_DEFAULT = 5 * 1024 * 1024; + public static final String OFFSETS_LOAD_BUFFER_SIZE_DOC = "Batch size for reading from the offsets segments when loading offsets into the cache (soft-limit, overridden if records are too large)."; + + public static final String OFFSETS_RETENTION_MINUTES_CONFIG = "offsets.retention.minutes"; + public static final int OFFSETS_RETENTION_MINUTES_DEFAULT = 7 * 24 * 60; + public static final String OFFSETS_RETENTION_MINUTES_DOC = "For subscribed consumers, committed offset of a specific partition will be expired and discarded when 1) this retention period has elapsed after the consumer group loses all its consumers (i.e. becomes empty); " + + "2) this retention period has elapsed since the last time an offset is committed for the partition and the group is no longer subscribed to the corresponding topic. " + + "For standalone consumers (using manual assignment), offsets will be expired after this retention period has elapsed since the time of last commit. " + + "Note that when a group is deleted via the delete-group request, its committed offsets will also be deleted without extra retention period; " + + "also when a topic is deleted via the delete-topic request, upon propagated metadata update any group's committed offsets for that topic will also be deleted without extra retention period."; + + public static final String OFFSETS_RETENTION_CHECK_INTERVAL_MS_CONFIG = "offsets.retention.check.interval.ms"; + public static final long OFFSETS_RETENTION_CHECK_INTERVAL_MS_DEFAULT = 600000L; + public static final String OFFSETS_RETENTION_CHECK_INTERVAL_MS_DOC = "Frequency at which to check for stale offsets"; + + public static final String OFFSETS_TOPIC_PARTITIONS_CONFIG = "offsets.topic.num.partitions"; + public static final int OFFSETS_TOPIC_PARTITIONS_DEFAULT = 50; + public static final String OFFSETS_TOPIC_PARTITIONS_DOC = "The number of partitions for the offset commit topic (should not change after deployment)."; + + public static final String OFFSETS_TOPIC_SEGMENT_BYTES_CONFIG = "offsets.topic.segment.bytes"; + public static final int OFFSETS_TOPIC_SEGMENT_BYTES_DEFAULT = 100 * 1024 * 1024; + public static final String OFFSETS_TOPIC_SEGMENT_BYTES_DOC = "The offsets topic segment bytes should be kept relatively small in order to facilitate faster log compaction and cache loads."; + + public static final String OFFSETS_TOPIC_REPLICATION_FACTOR_CONFIG = "offsets.topic.replication.factor"; + public static final short OFFSETS_TOPIC_REPLICATION_FACTOR_DEFAULT = 3; + public static final String OFFSETS_TOPIC_REPLICATION_FACTOR_DOC = "The replication factor for the offsets topic (set higher to ensure availability). " + + "Internal topic creation will fail until the cluster size meets this replication factor requirement."; + + public static final String OFFSETS_TOPIC_COMPRESSION_CODEC_CONFIG = "offsets.topic.compression.codec"; + public static final CompressionType OFFSETS_TOPIC_COMPRESSION_CODEC_DEFAULT = CompressionType.NONE; + public static final String OFFSETS_TOPIC_COMPRESSION_CODEC_DOC = "Compression codec for the offsets topic - compression may be used to achieve \"atomic\" commits."; + + public static final String OFFSET_COMMIT_TIMEOUT_MS_CONFIG = "offsets.commit.timeout.ms"; + public static final int OFFSET_COMMIT_TIMEOUT_MS_DEFAULT = 5000; + public static final String OFFSET_COMMIT_TIMEOUT_MS_DOC = "Offset commit will be delayed until all replicas for the offsets topic receive the commit " + + "or this timeout is reached. This is similar to the producer request timeout."; + + public static final String OFFSET_COMMIT_REQUIRED_ACKS_CONFIG = "offsets.commit.required.acks"; + public static final short OFFSET_COMMIT_REQUIRED_ACKS_DEFAULT = -1; + public static final String OFFSET_COMMIT_REQUIRED_ACKS_DOC = "The required acks before the commit can be accepted. In general, the default (-1) should not be overridden."; + + public static final long OFFSET_RETENTION_MS_DEFAULT = 24 * 60 * 60 * 1000L; Review Comment: yeah this is weird also because `OFFSET_RETENTION_MS_DEFAULT` has only be used as a default value for `OffsetConfig` constructor in the original scala code https://github.com/apache/kafka/pull/15161/files#diff-157be940464ab3026e373cbc03b515adc52cdc315aba96ecf384e1db85a93f29. While `GroupCoordinator::offsetConfig` was setting this value to `config.offsetsRetentionMinutes * 60L * 1000L`. I'll delete it as seems like no one is actually referring to this default value -- 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