kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colin McCabe <cmcc...@apache.org>
Subject Re: [DISCUSS]: KIP-339: Create a new ModifyConfigs API
Date Sat, 14 Jul 2018 00:51:33 GMT
On Fri, Jul 13, 2018, at 17:45, Ted Yu wrote:
> Looking at modifyConfigs API, it doesn't seem that ConcurrentHashMap
> should be used as the underlying parameter type.
I agree that there are other types of maps that do support null values.
However, the fact that some official map implementations from the
standard library don't support null values makes this a questionable
feature to rely on.  Imagine being a new user of this API who created a
ConcurrentHashMap, tried to insert some null keys, and pass to  the API.
It would compile, but not work.  It would certainly be confusing.
> Anyway, to signify that null value is supported, value type can be
> declared as Optional<Config>.> 
> FYI

Yeah, now that we're on Java 8, Optional could be a good choice here.

best,
Colin


> On Fri, Jul 13, 2018 at 5:35 PM Colin McCabe
> <cmccabe@apache.org> wrote:>> __
>> Hi Ted,
>> 
>> That’s a fair question.  I think the main reason I didn’t propose
>> that originally is that many people find null values in maps
>> confusing.  Also, some newer java maps don’t support null values,
>> such as ConcuurentHashMap.  I’m curious what others think about this.>> 
>> Best,
>> Colin
>> 
>> On Wed, Jul 11, 2018, at 21:28, Ted Yu wrote:
>> > bq.     Map<ConfigResource, Config> changes, Set<ConfigResource>
>> > removals,>> >
>> > Is it possible to combine the two parameters into one Map where
>> > null Config>> > value signifies removal of config ?
>> > This way, the following wouldn't occur (reducing un-intended config>>
> removal):
>> >
>> > bq. If a configuration key is specified in both *changes* and
>> > *removals*>> >
>> > *Cheers*
>> >
>> > On Wed, Jul 11, 2018 at 10:54 AM Colin McCabe <cmccabe@apache.org>
>> > wrote:>> >
>> > > Hi all,
>> > >
>> > > Previously, we discussed some issues with alterConfigs here on
>> > > the mailing>> > > list, and eventually came to the conclusion
that the RPC as
>> > > implemented>> > > can't be used for a shell command modifying
configurations.
>> > >
>> > > I wrote up a small KIP to fix the issues with the RPC.  Please
>> > > take a look>> > > at
>> > > https://cwiki.apache.org/confluence/display/KAFKA/KIP-339%3A+Create+a+new+ModifyConfigs+API>>
> >
>> > > best,
>> > > Colin
>> > >
>> 


Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message