{"action":"created","comment":{"url":"https://api.github.com/repos/apache/ambari-metrics/pulls/comments/222804871","pull_request_review_id":161781673,"id":222804871,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMjgwNDg3MQ==","diff_hunk":"@@ -629,75 +629,97 @@ public TimelineMetric getMetricFromUuid(byte[] uuid) {\n                                                 String instanceId,\n                                                 List<String> transientMetricNames) {\n \n-    Collection<String> sanitizedMetricNames = new HashSet<>();\n     List<byte[]> uuids = new ArrayList<>();\n \n+    boolean metricNameHasWildcard = false;\n     for (String metricName : metricNames) {\n-      if (metricName.contains(\"%\")) {\n-        String metricRegEx = getJavaRegexFromSqlRegex(metricName);\n-        for (TimelineMetricMetadataKey key : METADATA_CACHE.keySet()) {\n-          String metricNameFromMetadata = key.getMetricName();\n-          if (metricNameFromMetadata.matches(metricRegEx)) {\n-            sanitizedMetricNames.add(metricNameFromMetadata);\n-          }\n-        }\n-      } else {\n-        sanitizedMetricNames.add(metricName);\n+      if (hasWildCard(metricName)) {\n+        metricNameHasWildcard = true;\n       }\n     }\n \n-    if(sanitizedMetricNames.isEmpty()) {\n-      return uuids;\n+    boolean hostNameHasWildcard = false;\n+    if (CollectionUtils.isNotEmpty(hostnames)) {\n+      for (String hostname : hostnames) {\n+        if (hasWildCard(hostname)) {\n+          hostNameHasWildcard = true;","path":"ambari-metrics-timelineservice/src/main/java/org/apache/ambari/metrics/core/timeline/discovery/TimelineMetricMetadataManager.java","position":61,"original_position":61,"commit_id":"8ada02151f336bf2598116e0659bbc1f4fe0a9e2","original_commit_id":"8ada02151f336bf2598116e0659bbc1f4fe0a9e2","user":{"login":"swagle","id":3011545,"node_id":"MDQ6VXNlcjMwMTE1NDU=","avatar_url":"https://avatars2.githubusercontent.com/u/3011545?v=4","gravatar_id":"","url":"https://api.github.com/users/swagle","html_url":"https://github.com/swagle","followers_url":"https://api.github.com/users/swagle/followers","following_url":"https://api.github.com/users/swagle/following{/other_user}","gists_url":"https://api.github.com/users/swagle/gists{/gist_id}","starred_url":"https://api.github.com/users/swagle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swagle/subscriptions","organizations_url":"https://api.github.com/users/swagle/orgs","repos_url":"https://api.github.com/users/swagle/repos","events_url":"https://api.github.com/users/swagle/events{/privacy}","received_events_url":"https://api.github.com/users/swagle/received_events","type":"User","site_admin":false},"body":"break after first find!","created_at":"2018-10-04T19:49:52Z","updated_at":"2018-10-04T19:49:53Z","html_url":"https://github.com/apache/ambari-metrics/pull/5#discussion_r222804871","pull_request_url":"https://api.github.com/repos/apache/ambari-metrics/pulls/5","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/ambari-metrics/pulls/comments/222804871"},"html":{"href":"https://github.com/apache/ambari-metrics/pull/5#discussion_r222804871"},"pull_request":{"href":"https://api.github.com/repos/apache/ambari-metrics/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/apache/ambari-metrics/pulls/5","id":219911949,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5OTExOTQ5","html_url":"https://github.com/apache/ambari-metrics/pull/5","diff_url":"https://github.com/apache/ambari-metrics/pull/5.diff","patch_url":"https://github.com/apache/ambari-metrics/pull/5.patch","issue_url":"https://api.github.com/repos/apache/ambari-metrics/issues/5","number":5,"state":"open","locked":false,"title":"[AMBARI-24723] Support wild cards in AppId and InstanceId fields in AMS GET API.","user":{"login":"avijayanhwx","id":14299376,"node_id":"MDQ6VXNlcjE0Mjk5Mzc2","avatar_url":"https://avatars1.githubusercontent.com/u/14299376?v=4","gravatar_id":"","url":"https://api.github.com/users/avijayanhwx","html_url":"https://github.com/avijayanhwx","followers_url":"https://api.github.com/users/avijayanhwx/followers","following_url":"https://api.github.com/users/avijayanhwx/following{/other_user}","gists_url":"https://api.github.com/users/avijayanhwx/gists{/gist_id}","starred_url":"https://api.github.com/users/avijayanhwx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avijayanhwx/subscriptions","organizations_url":"https://api.github.com/users/avijayanhwx/orgs","repos_url":"https://api.github.com/users/avijayanhwx/repos","events_url":"https://api.github.com/users/avijayanhwx/events{/privacy}","received_events_url":"https://api.github.com/users/avijayanhwx/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\nAdd support for wildcards in appId and instanceId\r\n\r\n## How was this patch tested?\r\n\r\nManually tested.\r\nAdded unit test.","created_at":"2018-10-03T04:28:50Z","updated_at":"2018-10-04T19:49:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"111c3c59bcd109e6c2797ef4aa231889c35bd6a0","assignee":{"login":"avijayanhwx","id":14299376,"node_id":"MDQ6VXNlcjE0Mjk5Mzc2","avatar_url":"https://avatars1.githubusercontent.com/u/14299376?v=4","gravatar_id":"","url":"https://api.github.com/users/avijayanhwx","html_url":"https://github.com/avijayanhwx","followers_url":"https://api.github.com/users/avijayanhwx/followers","following_url":"https://api.github.com/users/avijayanhwx/following{/other_user}","gists_url":"https://api.github.com/users/avijayanhwx/gists{/gist_id}","starred_url":"https://api.github.com/users/avijayanhwx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avijayanhwx/subscriptions","organizations_url":"https://api.github.com/users/avijayanhwx/orgs","repos_url":"https://api.github.com/users/avijayanhwx/repos","events_url":"https://api.github.com/users/avijayanhwx/events{/privacy}","received_events_url":"https://api.github.com/users/avijayanhwx/received_events","type":"User","site_admin":false},"assignees":[{"login":"avijayanhwx","id":14299376,"node_id":"MDQ6VXNlcjE0Mjk5Mzc2","avatar_url":"https://avatars1.githubusercontent.com/u/14299376?v=4","gravatar_id":"","url":"https://api.github.com/users/avijayanhwx","html_url":"https://github.com/avijayanhwx","followers_url":"https://api.github.com/users/avijayanhwx/followers","following_url":"https://api.github.com/users/avijayanhwx/following{/other_user}","gists_url":"https://api.github.com/users/avijayanhwx/gists{/gist_id}","starred_url":"https://api.github.com/users/avijayanhwx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avijayanhwx/subscriptions","organizations_url":"https://api.github.com/users/avijayanhwx/orgs","repos_url":"https://api.github.com/users/avijayanhwx/repos","events_url":"https://api.github.com/users/avijayanhwx/events{/privacy}","received_events_url":"https://api.github.com/users/avijayanhwx/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"d0zen1","id":1679683,"node_id":"MDQ6VXNlcjE2Nzk2ODM=","avatar_url":"https://avatars1.githubusercontent.com/u/1679683?v=4","gravatar_id":"","url":"https://api.github.com/users/d0zen1","html_url":"https://github.com/d0zen1","followers_url":"https://api.github.com/users/d0zen1/followers","following_url":"https://api.github.com/users/d0zen1/following{/other_user}","gists_url":"https://api.github.com/users/d0zen1/gists{/gist_id}","starred_url":"https://api.github.com/users/d0zen1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d0zen1/subscriptions","organizations_url":"https://api.github.com/users/d0zen1/orgs","repos_url":"https://api.github.com/users/d0zen1/repos","events_url":"https://api.github.com/users/d0zen1/events{/privacy}","received_events_url":"https://api.github.com/users/d0zen1/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":1077582858,"node_id":"MDU6TGFiZWwxMDc3NTgyODU4","url":"https://api.github.com/repos/apache/ambari-metrics/labels/ambari-metrics-collector","name":"ambari-metrics-collector","color":"c0f9f8","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/apache/ambari-metrics/pulls/5/commits","review_comments_url":"https://api.github.com/repos/apache/ambari-metrics/pulls/5/comments","review_comment_url":"https://api.github.com/repos/apache/ambari-metrics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/ambari-metrics/issues/5/comments","statuses_url":"https://api.github.com/repos/apache/ambari-metrics/statuses/8ada02151f336bf2598116e0659bbc1f4fe0a9e2","head":{"label":"avijayanhwx:AMBARI-24723-master","ref":"AMBARI-24723-master","sha":"8ada02151f336bf2598116e0659bbc1f4fe0a9e2","user":{"login":"avijayanhwx","id":14299376,"node_id":"MDQ6VXNlcjE0Mjk5Mzc2","avatar_url":"https://avatars1.githubusercontent.com/u/14299376?v=4","gravatar_id":"","url":"https://api.github.com/users/avijayanhwx","html_url":"https://github.com/avijayanhwx","followers_url":"https://api.github.com/users/avijayanhwx/followers","following_url":"https://api.github.com/users/avijayanhwx/following{/other_user}","gists_url":"https://api.github.com/users/avijayanhwx/gists{/gist_id}","starred_url":"https://api.github.com/users/avijayanhwx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avijayanhwx/subscriptions","organizations_url":"https://api.github.com/users/avijayanhwx/orgs","repos_url":"https://api.github.com/users/avijayanhwx/repos","events_url":"https://api.github.com/users/avijayanhwx/events{/privacy}","received_events_url":"https://api.github.com/users/avijayanhwx/received_events","type":"User","site_admin":false},"repo":{"id":150323337,"node_id":"MDEwOlJlcG9zaXRvcnkxNTAzMjMzMzc=","name":"ambari-metrics","full_name":"avijayanhwx/ambari-metrics","private":false,"owner":{"login":"avijayanhwx","id":14299376,"node_id":"MDQ6VXNlcjE0Mjk5Mzc2","avatar_url":"https://avatars1.githubusercontent.com/u/14299376?v=4","gravatar_id":"","url":"https://api.github.com/users/avijayanhwx","html_url":"https://github.com/avijayanhwx","followers_url":"https://api.github.com/users/avijayanhwx/followers","following_url":"https://api.github.com/users/avijayanhwx/following{/other_user}","gists_url":"https://api.github.com/users/avijayanhwx/gists{/gist_id}","starred_url":"https://api.github.com/users/avijayanhwx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avijayanhwx/subscriptions","organizations_url":"https://api.github.com/users/avijayanhwx/orgs","repos_url":"https://api.github.com/users/avijayanhwx/repos","events_url":"https://api.github.com/users/avijayanhwx/events{/privacy}","received_events_url":"https://api.github.com/users/avijayanhwx/received_events","type":"User","site_admin":false},"html_url":"https://github.com/avijayanhwx/ambari-metrics","description":"Apache Ambari subproject - Ambari Metrics","fork":true,"url":"https://api.github.com/repos/avijayanhwx/ambari-metrics","forks_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/forks","keys_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/teams","hooks_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/hooks","issue_events_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/issues/events{/number}","events_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/events","assignees_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/assignees{/user}","branches_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/branches{/branch}","tags_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/tags","blobs_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/statuses/{sha}","languages_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/languages","stargazers_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/stargazers","contributors_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/contributors","subscribers_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/subscribers","subscription_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/subscription","commits_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/contents/{+path}","compare_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/merges","archive_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/downloads","issues_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/issues{/number}","pulls_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/pulls{/number}","milestones_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/milestones{/number}","notifications_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/labels{/name}","releases_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/releases{/id}","deployments_url":"https://api.github.com/repos/avijayanhwx/ambari-metrics/deployments","created_at":"2018-09-25T20:11:27Z","updated_at":"2018-09-25T20:11:30Z","pushed_at":"2018-10-04T18:21:34Z","git_url":"git://github.com/avijayanhwx/ambari-metrics.git","ssh_url":"git@github.com:avijayanhwx/ambari-metrics.git","clone_url":"https://github.com/avijayanhwx/ambari-metrics.git","svn_url":"https://github.com/avijayanhwx/ambari-metrics","homepage":"https://ambari.apache.org/","size":9047,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"dc75b010c9661b1b4f0dce78e5e592439f57717e","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":150309255,"node_id":"MDEwOlJlcG9zaXRvcnkxNTAzMDkyNTU=","name":"ambari-metrics","full_name":"apache/ambari-metrics","private":false,"owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/apache/ambari-metrics","description":"Apache Ambari subproject - Ambari Metrics","fork":false,"url":"https://api.github.com/repos/apache/ambari-metrics","forks_url":"https://api.github.com/repos/apache/ambari-metrics/forks","keys_url":"https://api.github.com/repos/apache/ambari-metrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/ambari-metrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/ambari-metrics/teams","hooks_url":"https://api.github.com/repos/apache/ambari-metrics/hooks","issue_events_url":"https://api.github.com/repos/apache/ambari-metrics/issues/events{/number}","events_url":"https://api.github.com/repos/apache/ambari-metrics/events","assignees_url":"https://api.github.com/repos/apache/ambari-metrics/assignees{/user}","branches_url":"https://api.github.com/repos/apache/ambari-metrics/branches{/branch}","tags_url":"https://api.github.com/repos/apache/ambari-metrics/tags","blobs_url":"https://api.github.com/repos/apache/ambari-metrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/ambari-metrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/ambari-metrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/ambari-metrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/ambari-metrics/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/ambari-metrics/languages","stargazers_url":"https://api.github.com/repos/apache/ambari-metrics/stargazers","contributors_url":"https://api.github.com/repos/apache/ambari-metrics/contributors","subscribers_url":"https://api.github.com/repos/apache/ambari-metrics/subscribers","subscription_url":"https://api.github.com/repos/apache/ambari-metrics/subscription","commits_url":"https://api.github.com/repos/apache/ambari-metrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/ambari-metrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/ambari-metrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/ambari-metrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/ambari-metrics/contents/{+path}","compare_url":"https://api.github.com/repos/apache/ambari-metrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/ambari-metrics/merges","archive_url":"https://api.github.com/repos/apache/ambari-metrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/ambari-metrics/downloads","issues_url":"https://api.github.com/repos/apache/ambari-metrics/issues{/number}","pulls_url":"https://api.github.com/repos/apache/ambari-metrics/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/ambari-metrics/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/ambari-metrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/ambari-metrics/labels{/name}","releases_url":"https://api.github.com/repos/apache/ambari-metrics/releases{/id}","deployments_url":"https://api.github.com/repos/apache/ambari-metrics/deployments","created_at":"2018-09-25T18:12:23Z","updated_at":"2018-10-03T21:50:39Z","pushed_at":"2018-10-04T18:21:35Z","git_url":"git://github.com/apache/ambari-metrics.git","ssh_url":"git@github.com:apache/ambari-metrics.git","clone_url":"https://github.com/apache/ambari-metrics.git","svn_url":"https://github.com/apache/ambari-metrics","homepage":"https://ambari.apache.org/","size":9116,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/ambari-metrics/pulls/5"},"html":{"href":"https://github.com/apache/ambari-metrics/pull/5"},"issue":{"href":"https://api.github.com/repos/apache/ambari-metrics/issues/5"},"comments":{"href":"https://api.github.com/repos/apache/ambari-metrics/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/ambari-metrics/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/ambari-metrics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/ambari-metrics/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/apache/ambari-metrics/statuses/8ada02151f336bf2598116e0659bbc1f4fe0a9e2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"swagle"}}