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/05 13:21:26 UTC

[GitHub] [hadoop-ozone] elek commented on a change in pull request #299: HDDS-2070. Create insight point to debug one specific pipeline

elek commented on a change in pull request #299: HDDS-2070. Create insight point to debug one specific pipeline
URL: https://github.com/apache/hadoop-ozone/pull/299#discussion_r354308279
 
 

 ##########
 File path: hadoop-ozone/insight/src/main/java/org/apache/hadoop/ozone/insight/datanode/RatisInsight.java
 ##########
 @@ -39,31 +39,43 @@
  */
 public class RatisInsight extends BaseInsightPoint implements InsightPoint {
 
+  public static final String PIPLINE_FILTER = "pipeline";
   private OzoneConfiguration conf;
 
   public RatisInsight(OzoneConfiguration conf) {
     this.conf = conf;
   }
 
   @Override
-  public List<LoggerSource> getRelatedLoggers(boolean verbose) {
+  public List<LoggerSource> getRelatedLoggers(boolean verbose,
+      Map<String, String> filters) {
+    if (filters == null || !filters.containsKey(PIPLINE_FILTER)) {
+      throw new IllegalArgumentException(PIPLINE_FILTER
+          + " filter should be specified (-f pipline=<pipelineid)");
+    }
+
+    String pipelineId = filters.get(PIPLINE_FILTER);
     List<LoggerSource> result = new ArrayList<>();
-    try {
-      Optional<Pipeline> pipeline;
-      try (ScmClient scmClient = createScmClient(conf)) {
-        pipeline = scmClient.listPipelines()
-            .stream()
-            .filter(d -> d.getNodes().size() > 1)
-            .findFirst();
+
+    try (ScmClient scmClient = createScmClient(conf)) {
+      Optional<Pipeline> pipelineSelection = scmClient.listPipelines()
+          .stream()
+          .filter(d -> d.getNodes().size() > 1)
 
 Review comment:
   Not sure if this insight is useful for Ratis/ONE but let's remove it. If we would like to forbid the usage for Ratis/One it should be done with a more explicit check.
   
   Line is removed.

----------------------------------------------------------------
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