[ 
https://issues.apache.org/jira/browse/KAFKA-2702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14979782#comment-14979782
 ] 

Jay Kreps commented on KAFKA-2702:
----------------------------------

Originally the presence or absence of a default indicated whether something was 
required--i.e. *all* fields are required to have a value but you can provide a 
default. Looks like later someone wanted to make a separate variable for 
whether it was required (not sure why) and they decided that if there was no 
default they would just fill in null as the default. But this change doesn't 
seem to have been fully carried out.

The original approach was actually done that way on purpose. In the new 
approach setting a config to non-required field seems to be a duplicative way 
of saying a config with a default value of null, which you could already do. 
But null is actually not always a very good default value to set so having 
people explicitly give the default for non-required fields is probably good.

For example what happens if I have a non-required int config with no default 
and I do something like
  int myValue = config.getInt(MYCONFIGNAME);
I think I will get a null pointer.

I think this happened in KAFKA-1845 so it might be good to figure out what the 
intention was in the change, probably there was some issue this fixed...

> ConfigDef toHtmlTable() sorts in a way that is a bit confusing
> --------------------------------------------------------------
>
>                 Key: KAFKA-2702
>                 URL: https://issues.apache.org/jira/browse/KAFKA-2702
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Gwen Shapira
>            Assignee: Grant Henke
>         Attachments: ConsumerConfig-After.html, ConsumerConfig-Before.html
>
>
> Because we put everything without default first (without prioritizing), 
> critical  parameters get placed below low priority ones when they both have 
> no defaults. Some parameters are without default and optional (SASL server in 
> ConsumerConfig for instance).
> Try printing ConsumerConfig parameters and see the mandatory group.id show up 
> as #15.
> I suggest sorting the no-default parameters by priority as well, or perhaps 
> adding a "REQUIRED" category that gets printed first no matter what.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to