Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 b26502b70 -> 7e844df4d


AMBARI-19320 : Additional query support for HDFS TopN metrics (Commit 2) 
(avijayan)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7e844df4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7e844df4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7e844df4

Branch: refs/heads/branch-2.5
Commit: 7e844df4d6ace55ead09ea44584b9037b7b4e943
Parents: b26502b
Author: Aravindan Vijayan <[email protected]>
Authored: Wed Jan 4 15:30:09 2017 -0800
Committer: Aravindan Vijayan <[email protected]>
Committed: Wed Jan 4 15:30:17 2017 -0800

----------------------------------------------------------------------
 .../metrics/timeline/PhoenixHBaseAccessor.java                | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7e844df4/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
----------------------------------------------------------------------
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
index 250383f..8d567ce 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
@@ -1137,8 +1137,11 @@ public class PhoenixHBaseAccessor {
     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("%", ".*");

Reply via email to