The ConfigDef.define() methods, which create ConfigKey instances, have increased the number of parameters past the point where a Builder is recommended. The ConfigKey class is not final but extending it has become difficult.
Developing additional functionality for ConfigKey requires changes to the current ConfigKey and ConfigDef classes. Implementing a ConfigKey.Builder class will make development of new ConfigKey functionality easier because changes can be more localized.
Adds a new interface to construct the ConfigKey that may be used in parallel with the existing ConfigDef.define() methods.
This proposal adds a ConfigKey.Builder class that will construct ConfigKey instances equivalent to the ConfigDef.define() methods while allowing for extensibility. This proposal does not remove any define() method nor mark them as deprecated.
The builder must:
The result of the build() method is equivalent to the ConfigKey.defin() method, as such no compatibility issues are expected.
While ConfigDef.define() could be deprecated, there are no plans to do so under this proposal. If accepted, it is expected that the builder will be used in favor of the ConfigDef.define() method in future development due to ease of use. Deprecation of ConfigDef.define() is left to a future KIP.
No migration is proposed. Developers may utilize either the current ConfigDef.define() methods or the ConfigKey.builder() methods as they see fit.
Test Plan
Unit tests to verify that builder constructed ConfigKeys are equivalent to current ConfigKeys,define() method results.
Unit tests to verify that the builder can be extended.
none