You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2019/12/30 01:58:41 UTC

[GitHub] [hadoop-ozone] maobaolong commented on a change in pull request #390: HDDS-2737. Insight point should provide service type to get correct config

maobaolong commented on a change in pull request #390: HDDS-2737. Insight point should provide service type to get correct config
URL: https://github.com/apache/hadoop-ozone/pull/390#discussion_r361885649
 
 

 ##########
 File path: hadoop-ozone/insight/src/main/java/org/apache/hadoop/ozone/insight/ConfigurationSubCommand.java
 ##########
 @@ -51,16 +51,31 @@ public Void call() throws Exception {
         "Configuration for `" + insightName + "` (" + insight.getDescription()
             + ")");
     System.out.println();
-    for (Class clazz : insight.getConfigurationClasses()) {
-      showConfig(clazz);
 
+    Type type;
+    switch (insightName.split("\\.")[0]) {
 
 Review comment:
   How about change the switch expression to the following way?
   
   ```java
   try {
     Type type =Type.valueOf(insightName.split("\\.")[0]);
   } catch (IllegalArgumentException e) {
      throw new RuntimeException("No such component " + insightName);
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org