adoroszlai commented on a change in pull request #1255: HDDS-1935. Improve the 
visibility with Ozone Insight tool
URL: https://github.com/apache/hadoop/pull/1255#discussion_r314483408
 
 

 ##########
 File path: 
hadoop-ozone/insight/src/main/java/org/apache/hadoop/ozone/insight/ConfigurationSubCommand.java
 ##########
 @@ -0,0 +1,70 @@
+package org.apache.hadoop.ozone.insight;
+
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.conf.Config;
+import org.apache.hadoop.hdds.conf.ConfigGroup;
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+
+import picocli.CommandLine;
+
+import java.lang.reflect.Method;
+import java.util.concurrent.Callable;
+
+/**
+ * Subcommand to show configuration values/documentation.
+ */
+@CommandLine.Command(
+    name = "config",
+    description = "Show configuration for a specific subcomponents",
+    mixinStandardHelpOptions = true,
+    versionProvider = HddsVersionProvider.class)
+public class ConfigurationSubCommand extends BaseInsightSubcommand
+    implements Callable<Void> {
+
+  @CommandLine.Parameters(defaultValue = "")
+  private String selection;
+
+  @Override
+  public Void call() throws Exception {
+    InsightPoint insight =
+        getInsight(getInsightCommand().createOzoneConfiguration(), selection);
+    System.out.println(
+        "Configuration for `" + selection + "` (" + insight.getDescription()
+            + ")");
+    System.out.println();
+    for (Class clazz : insight.getConfigurationClasses()) {
+      showConfig(clazz);
+
+    }
+    return null;
+  }
+
+  private void showConfig(Class clazz) {
+    OzoneConfiguration conf = new OzoneConfiguration();
+    conf.addResource("http://localhost:9876/conf";);
 
 Review comment:
   Is this SCM-specific?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to