bdbyrne commented on pull request #8610:
URL: https://github.com/apache/kafka/pull/8610#issuecomment-624318905


   > > Hi @bdbyrne , thanks for the comment. The link seems not working. I 
guess you mean this part we should replace the empty string "" by null?
   > > > ```
   > > > private[admin] def entityNames(): List[String] = {
   > > >   val namesIterator = options.valuesOf(entityName).iterator
   > > >   options.specs.asScala
   > > >     .filter(spec => spec.options.contains("entity-name") || 
spec.options.contains("entity-default"))
   > > >     .map(spec => if (spec.options.contains("entity-name")) 
namesIterator.next else "").toList ++
   > > >   entityFlags
   > > >     .filter(entity => options.has(entity._1))
   > > >     .map(entity => options.valueOf(entity._1)) ++
   > > >   entityDefaultsFlags
   > > >     .filter(entity => options.has(entity._1))
   > > >     .map(_ => "")
   > > > }
   > > > ```
   > 
   > That's correct, yes. You could do it in the provided code, however keep in 
mind that the ZK path currently uses it as well and would expect the empty 
string. The alternative is to do the substitution (`"" -> null`) when creating 
the `ClientQuotaEntity`, which is exclusive to the `AdminClient` path.
   
   Oh wait, there's also other places where the default is used and expected to 
be the empty string (broker config), so it may be best to only make the change 
at the `ClientQuotaEntity`.


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


Reply via email to