[
https://issues.apache.org/jira/browse/HDDS-1744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stephen O'Donnell reassigned HDDS-1744:
---------------------------------------
Assignee: (was: Stephen O'Donnell)
> Improve BaseHttpServer to use typesafe configuration.
> -----------------------------------------------------
>
> Key: HDDS-1744
> URL: https://issues.apache.org/jira/browse/HDDS-1744
> Project: Apache Ozone
> Issue Type: Sub-task
> Reporter: Marton Elek
> Priority: Major
>
> As it's defined in the parent task, we have a new typesafe way to define
> configuration based on annotations instead of constants.
> The next step is to replace existing code to use the new code.
> In this Jira I propose to improve the
> org.apache.hadoop.hdds.server.BaseHttpServer to use configuration object
> instead of constants.
> We need to create a generic configuration object with the right annotation:
> {code:java}
> public class OzoneHttpServerConfig{
>
> private String httpBindHost
> @Config(key = "http-bind-host",
> defaultValue = "0.0.0.0",
> description = "The actual address the web server will bind to. If "
> + "this optional address is set, it overrides only the hostname"
> + " portion of http-address configuration value.",
> tags = {ConfigTag.OM, ConfigTag.MANAGEMENT})
> public void setHttpBindHost(String httpBindHost) {
> this.httpBindHost = httpBindHost;
> }
> ....
> }{code}
> And we need to extend this basic configuration in all the HttpServer
> implementation:
> {code:java}
> public class OzoneManagerHttpServer extends BaseHttpServer{
>
> @ConfigGroup(prefix = "ozone.om")
> public static class HttpConfig extends OzoneHttpServerConfig {
>
> @Override
> @ConfigOverride(defaultValue = "9874")
> public void setHttpBindPort(int httpBindPort) {
> super.setHttpBindPort(httpBindPort);
> }
>
> }
> }{code}
> Note: configuration keys used by HttpServer2 can't be replaced easly.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]