You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configuration should be immutable. Being able to update the configuration of the Pulsar instance by using provided set methods is not safe for the program. It also isn't consistent. Some changes have an effect, some do not.
There would be a number of changes required in unit tests. Some of the unit tests mutate a single configuration instance. Preferably, all tests should run on a clean environment.
I have done some preliminary work on this but I'd need merge master into it and make sure all tests pass.
Generally, if Typesafe Config is an acceptable option, I'd be happy to take this one.
Typesafe config looks like a very nice written library.
For broker config, I'd be ok to use it to populate the ServiceConfiguration. I'd like to maintain to have a single point to have to update when adding a new config variable. Currently, ServiceConfiguration is a pojo, and you just need to add a new variable with default value and example in conf/broker.conf.
Alternatively, what about having ServiceConfiguration with only getters and adding a ServiceConfigurationBuilder?
This isn't a finished PR, tests need much more work. Also, the validation of minValue and maxValue isn't implemented but would be rather straightforward to implement.
To comply with what Typesafe Config needs, we would have to add reference.conf file to the resources.
For config file, would it be possible to maintain the same java properties format? That would keep it consistent with the other config files (client, bookkeeper, ..). It seems the only change is right now the pulsar {....} enclosing namespace.
I think that having to specify the config var name (either a string or a constant), makes a it bit more complicated to configure programmatically, since you have to lookup for the list of allowed variables, while with setters it's easy to discover all the options.
@merlimat I'd suggest using the hocon format across all configuration. The reason is that if someone builds software where Pulsar is only one of the components using Typesafe Config, they can single hocon file for all their components. We can keep the properties look and feel but, at least, I'd suggest prefixing all settings with pulsar. to give them a namespace.
As for having to know the property names, yes, this is slightly inconvenient but, I think, you are looking from the perspective of unit tests. Preferably, all configuration variants would come as a separate .conf file. Combined with a reference.conf, everything is covered. However, if that is not enough, we can always implement a builder which would construct the necessary properties. The base is what it is, how config properties are constructed, we can change that to a friendlier looking version.
I would rather not break the config file compatibility unless is really necessary. Also, the other concern is that bookkeeper.conf and zookeeper.conf will still be in Java properties format and that cannot be easily changed.
Activity
[-]Configuration should bd immutable[/-][+]Configuration should be immutable[/+]merlimat commentedon Sep 28, 2016
Typesafe config looks like a very nice written library.
For broker config, I'd be ok to use it to populate the ServiceConfiguration. I'd like to maintain to have a single point to have to update when adding a new config variable. Currently,
ServiceConfigurationis a pojo, and you just need to add a new variable with default value and example inconf/broker.conf.Alternatively, what about having
ServiceConfigurationwith only getters and adding aServiceConfigurationBuilder?radekg commentedon Sep 28, 2016
Pushed the branch to remote but no pr, just so you can have a look. The most interesting points:
ServiceConfigurationwraps and instance of Typesafe Config: https://github.com/radekg/pulsar/blob/7f58a69a2b51c1b3dfca7e03438e9cd1ec5a3afe/pulsar-broker-common/src/main/java/com/yahoo/pulsar/broker/ServiceConfiguration.javaThis isn't a finished PR, tests need much more work. Also, the validation of
minValueandmaxValueisn't implemented but would be rather straightforward to implement.To comply with what Typesafe Config needs, we would have to add
reference.conffile to theresources.Have a look, let me know what you think.
merlimat commentedon Sep 28, 2016
For config file, would it be possible to maintain the same java properties format? That would keep it consistent with the other config files (client, bookkeeper, ..). It seems the only change is right now the
pulsar {....}enclosing namespace.I think that having to specify the config var name (either a string or a constant), makes a it bit more complicated to configure programmatically, since you have to lookup for the list of allowed variables, while with setters it's easy to discover all the options.
merlimat commentedon Sep 28, 2016
But other than the 2 notes above, it seems nice to combine multiple config sources
radekg commentedon Sep 28, 2016
@merlimat I'd suggest using the hocon format across all configuration. The reason is that if someone builds software where Pulsar is only one of the components using Typesafe Config, they can single hocon file for all their components. We can keep the properties look and feel but, at least, I'd suggest prefixing all settings with
pulsar.to give them a namespace.As for having to know the property names, yes, this is slightly inconvenient but, I think, you are looking from the perspective of unit tests. Preferably, all configuration variants would come as a separate
.conffile. Combined with areference.conf, everything is covered. However, if that is not enough, we can always implement a builder which would construct the necessary properties. The base is what it is, how config properties are constructed, we can change that to a friendlier looking version.Shall I come up with a full PR?
merlimat commentedon Sep 30, 2016
I would rather not break the config file compatibility unless is really necessary. Also, the other concern is that
bookkeeper.confandzookeeper.confwill still be in Java properties format and that cannot be easily changed.ivankelly commentedon Aug 30, 2018
This seems to have gone quiet. Closing. Please reopen if you want this work to continue.
[issue:40]Fix producer send protocol error (apache#42)
Add Batch support (apache#42)
[tests] Add Kinesis Sink integration tests (#42)
[tests] Add Kinesis Sink integration tests (#42)
[tests] Add Kinesis Sink integration tests (#42)
[hotfix] Improve CI trigger and cancel strategy (apache#42)
[feat][broker] PIP-344 (#42)