commit | 6120ea99e7bd842d07ac58adbe434f52830c431d | [log] [tgz] |
---|---|---|
author | Aravindan Vijayan <avijayan@hortonworks.com> | Thu Dec 29 13:23:45 2016 -0800 |
committer | Aravindan Vijayan <avijayan@hortonworks.com> | Thu Dec 29 13:23:45 2016 -0800 |
tree | 5cd2e28672a0a932ee0cecae3f0f5b52f3e4b7a8 | |
parent | 022224952fc5274187f67b846f5f53cf5eaa7032 [diff] |
AMBARI-19320 : Additional query support for HDFS TopN metrics. (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 c1fa328..3ced17d 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
@@ -1147,7 +1147,14 @@ } for (String metricNameEntry : metricFunctions.keySet()) { - String metricRegEx = metricNameEntry.replace("%", ".*"); + + String metricRegEx; + if (metricNameEntry.contains("*")) { + String metricNameWithEscSeq = metricNameEntry.replace("*","\\*"); + metricRegEx = metricNameWithEscSeq.replace("%", ".*"); + } else { + metricRegEx = metricNameEntry.replace("%", ".*"); + } if (metricName.matches(metricRegEx)) { return metricFunctions.get(metricNameEntry); }