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

2019-10-03 Thread GitBox
adoroszlai commented on a change in pull request #1583: HDDS-2071. Support 
filters in ozone insight point
URL: https://github.com/apache/hadoop/pull/1583#discussion_r331205328
 
 

 ##
 File path: 
hadoop-ozone/insight/src/main/java/org/apache/hadoop/ozone/insight/LogSubcommand.java
 ##
 @@ -59,6 +61,10 @@
   + "show more information / detailed message")
   private boolean verbose;
 
+  @CommandLine.Option(names = "-f", description = "Enable verbose mode to "
+  + "show more information / detailed message")
 
 Review comment:
   Description should be updated (is copied from `-v`).


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



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

2019-10-03 Thread GitBox
adoroszlai commented on a change in pull request #1583: HDDS-2071. Support 
filters in ozone insight point
URL: https://github.com/apache/hadoop/pull/1583#discussion_r331208222
 
 

 ##
 File path: 
hadoop-ozone/insight/src/main/java/org/apache/hadoop/ozone/insight/BaseInsightPoint.java
 ##
 @@ -185,4 +186,18 @@ public void addRpcMetrics(List 
metrics,
 metrics.add(performance);
   }
 
+  @Override
+  public boolean filterLog(Map filters, String logLine) {
+if (filters == null) {
+  return true;
+}
+boolean result = true;
+for (Entry entry : filters.entrySet()) {
+  if (!logLine.matches(
+  String.format(".*\\[%s=%s\\].*", entry.getKey(), entry.getValue( 
{
+result = result & false;
 
 Review comment:
   Can be simplified to `return false;`.


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



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

2019-10-03 Thread GitBox
adoroszlai commented on a change in pull request #1583: HDDS-2071. Support 
filters in ozone insight point
URL: https://github.com/apache/hadoop/pull/1583#discussion_r331207138
 
 

 ##
 File path: 
hadoop-ozone/insight/src/main/java/org/apache/hadoop/ozone/insight/LogSubcommand.java
 ##
 @@ -86,12 +93,20 @@ public Void call() throws Exception {
 return null;
   }
 
+  /**
+   * Stream log from multiple endpoint.
+   *
+   * @param conf   Configuration (to find the log endpoints)
+   * @param sourcesComponents to connect to (like scm, om...)
+   * @param relatedLoggers loggers to display
+   * @param filter any additional filter
+   */
   private void streamLog(OzoneConfiguration conf, Set sources,
-  List relatedLoggers) {
+  List relatedLoggers, Function filter) {
 
 Review comment:
   I'd prefer a `Predicate` for simplicity (and null-safety).


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