Elek, Marton created HDDS-1744:
----------------------------------
Summary: Improve BaseHttpServer to use typesafe configuration.
Key: HDDS-1744
URL: https://issues.apache.org/jira/browse/HDDS-1744
Project: Hadoop Distributed Data Store
Issue Type: Sub-task
Reporter: Elek, Marton
Assignee: Stephen O'Donnell
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
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]