You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Yiqun Lin (Jira)" <ji...@apache.org> on 2019/12/14 09:35:00 UTC
[jira] [Created] (HDDS-2737) Insight point should provide service
type to get correct config
Yiqun Lin created HDDS-2737:
-------------------------------
Summary: 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
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org