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/04 17:18:58 UTC

[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #299: HDDS-2071. Support filters in ozone insight point

adoroszlai commented on a change in pull request #299: HDDS-2071. Support filters in ozone insight point
URL: https://github.com/apache/hadoop-ozone/pull/299#discussion_r353874274
 
 

 ##########
 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:
   Do we need the size filter, given that pipeline ID is required?

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