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<MetricGroupDisplay> 
metrics,
     metrics.add(performance);
   }
 
+  @Override
+  public boolean filterLog(Map<String, String> filters, String logLine) {
+    if (filters == null) {
+      return true;
+    }
+    boolean result = true;
+    for (Entry<String, String> 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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to