commit | 856999291191b74620e19afc6d9a0b96e13c5b05 | [log] [tgz] |
---|---|---|
author | Aravindan Vijayan <avijayan@hortonworks.com> | Wed Jan 04 15:31:05 2017 -0800 |
committer | Aravindan Vijayan <avijayan@hortonworks.com> | Wed Jan 04 15:31:05 2017 -0800 |
tree | 2cea37d1cf843ab3a932742ab4700134f6c3fe51 | |
parent | 6120ea99e7bd842d07ac58adbe434f52830c431d [diff] |
AMBARI-19320 : Additional query support for HDFS TopN metrics (Commit 2) (avijayan)
diff --git a/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java b/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java index 3ced17d..3add411 100644 --- a/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java +++ b/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
@@ -1149,8 +1149,11 @@ for (String metricNameEntry : metricFunctions.keySet()) { String metricRegEx; - if (metricNameEntry.contains("*")) { - String metricNameWithEscSeq = metricNameEntry.replace("*","\\*"); + //Special case handling for metric name with * and __%. + //For example, dfs.NNTopUserOpCounts.windowMs=300000.op=*.user=%.count + // or dfs.NNTopUserOpCounts.windowMs=300000.op=__%.user=%.count + if (metricNameEntry.contains("*") || metricNameEntry.contains("__%")) { + String metricNameWithEscSeq = metricNameEntry.replace("*", "\\*").replace("__%", "..%"); metricRegEx = metricNameWithEscSeq.replace("%", ".*"); } else { metricRegEx = metricNameEntry.replace("%", ".*");