Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      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:

      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;
       }
      
      ....
      }

      And we need to extend this basic configuration in all the HttpServer implementation:

      
      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);
          }
      
       
         }
      }

      Note: configuration keys used by HttpServer2 can't be replaced easly.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              elek Marton Elek
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: