[ 
https://issues.apache.org/jira/browse/HDDS-2737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marton Elek resolved HDDS-2737.
-------------------------------
       Fix Version/s: 0.5.0
    Target Version/s: 0.5.0
          Resolution: Fixed

> Insight point should provide service type to get correct config
> ---------------------------------------------------------------
>
>                 Key: HDDS-2737
>                 URL: https://issues.apache.org/jira/browse/HDDS-2737
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 0.4.1
>            Reporter: Yiqun Lin
>            Assignee: YiSheng Lien
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 0.5.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently, ozone insight cmd can help us get config that being used in ozone 
> service. However, sometimes it maybe not redirect the request for the right 
> service.
> For example, we want to query the om insight point, om.key-manager, but 
> ConfigurationSubCommand hard coded use SCM type to get service conf. The 
> method getHost will return the address of SCM service but actually we need to 
> get the OM service which is the right service we want to query from.
>  
> {code:java}
>   private void showConfig(Class clazz) {
>     OzoneConfiguration conf = new OzoneConfiguration();
>     conf.addResource(getHost(conf, new Component(Type.SCM)) + "/conf");
>     ConfigGroup configGroup =
>         (ConfigGroup) clazz.getAnnotation(ConfigGroup.class);
>     if (configGroup == null) {
>       return;
>     }
>     String prefix = configGroup.prefix();
>     for (Method method : clazz.getMethods()) {
>       if (method.isAnnotationPresent(Config.class)) {
>         Config config = method.getAnnotation(Config.class);
>         String key = prefix + "." + config.key();
>         System.out.println(">>> " + key);
>         System.out.println("       default: " + config.defaultValue());
>         System.out.println("       current: " + conf.get(key));
>         System.out.println();
>         System.out.println(config.description());
>         System.out.println();
>         System.out.println();
>       }
>     }
>   }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to