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 2022/04/05 00:02:27 UTC
[GitHub] [kafka] RivenSun2 commented on a diff in pull request #11985: MINOR: Supplement the description of `Valid Values` in the documentation of `compression.type`
RivenSun2 commented on code in PR #11985:
URL: https://github.com/apache/kafka/pull/11985#discussion_r842228787
##########
clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java:
##########
@@ -329,7 +330,7 @@
in("all", "-1", "0", "1"),
Importance.LOW,
ACKS_DOC)
- .define(COMPRESSION_TYPE_CONFIG, Type.STRING, "none", Importance.HIGH, COMPRESSION_TYPE_DOC)
+ .define(COMPRESSION_TYPE_CONFIG, Type.STRING, CompressionType.NONE.name, in(CompressionType.names().toArray(new String[0])), Importance.HIGH, COMPRESSION_TYPE_DOC)
Review Comment:
1. The parameters we need to pass in the validator here are `[none, gzip, snappy, lz4, zstd]`, not `[NONE, GZIP, SNAPPY, LZ4, ZSTD]`. So here I am not using the `Utils.enumOptions()` method directly.
2. Add the static method `names()` to `CompressionType`, so that this method can be called in places with the same requirements in the future.
WDYT?
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org