Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
0.4.1
Description
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.
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(); } } }
Attachments
Issue Links
- links to