{"action":"created","comment":{"url":"https://api.github.com/repos/apache/ambari/pulls/comments/170258432","pull_request_review_id":98920605,"id":170258432,"diff_hunk":"@@ -380,13 +373,12 @@ public String getServiceForComponent(String component) {\n   }\n \n   @Override\n-  public Collection<String> getServicesForComponents(Collection<String> components) {\n-    Set<String> services = new HashSet<>();\n-    for (String component : components) {\n-      services.add(getServiceForComponent(component));\n-    }\n-\n-    return services;\n+  @Nonnull\n+  public Stream<Pair<StackId, String>> getServicesForComponent(String component) {\n+    String service = getServiceForComponent(component);\n+    return service != null\n+      ? Stream.of(Pair.of(getStackId(), service))\n+      : Stream.empty();\n   }","path":"ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Stack.java","position":73,"original_position":73,"commit_id":"a79dd887db02fb4337ffbe12a361dfa71cbe0abe","original_commit_id":"fa03d296ffda2e9f1a170964c8848e547765d85f","user":{"login":"adoroszlai","id":6454655,"avatar_url":"https://avatars2.githubusercontent.com/u/6454655?v=4","gravatar_id":"","url":"https://api.github.com/users/adoroszlai","html_url":"https://github.com/adoroszlai","followers_url":"https://api.github.com/users/adoroszlai/followers","following_url":"https://api.github.com/users/adoroszlai/following{/other_user}","gists_url":"https://api.github.com/users/adoroszlai/gists{/gist_id}","starred_url":"https://api.github.com/users/adoroszlai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adoroszlai/subscriptions","organizations_url":"https://api.github.com/users/adoroszlai/orgs","repos_url":"https://api.github.com/users/adoroszlai/repos","events_url":"https://api.github.com/users/adoroszlai/events{/privacy}","received_events_url":"https://api.github.com/users/adoroszlai/received_events","type":"User","site_admin":false},"body":"Yes, there can be multiple services in `CompositeStack`.  The goal is to have a common interface `StackDefinition`.","created_at":"2018-02-23T14:04:56Z","updated_at":"2018-02-23T14:04:56Z","html_url":"https://github.com/apache/ambari/pull/444#discussion_r170258432","pull_request_url":"https://api.github.com/repos/apache/ambari/pulls/444","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/ambari/pulls/comments/170258432"},"html":{"href":"https://github.com/apache/ambari/pull/444#discussion_r170258432"},"pull_request":{"href":"https://api.github.com/repos/apache/ambari/pulls/444"}},"in_reply_to_id":170205395},"pull_request":{"url":"https://api.github.com/repos/apache/ambari/pulls/444","id":170813237,"html_url":"https://github.com/apache/ambari/pull/444","diff_url":"https://github.com/apache/ambari/pull/444.diff","patch_url":"https://github.com/apache/ambari/pull/444.patch","issue_url":"https://api.github.com/repos/apache/ambari/issues/444","number":444,"state":"open","locked":false,"title":"[AMBARI-22875] Use mpacks specified in cluster creation request","user":{"login":"adoroszlai","id":6454655,"avatar_url":"https://avatars2.githubusercontent.com/u/6454655?v=4","gravatar_id":"","url":"https://api.github.com/users/adoroszlai","html_url":"https://github.com/adoroszlai","followers_url":"https://api.github.com/users/adoroszlai/followers","following_url":"https://api.github.com/users/adoroszlai/following{/other_user}","gists_url":"https://api.github.com/users/adoroszlai/gists{/gist_id}","starred_url":"https://api.github.com/users/adoroszlai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adoroszlai/subscriptions","organizations_url":"https://api.github.com/users/adoroszlai/orgs","repos_url":"https://api.github.com/users/adoroszlai/repos","events_url":"https://api.github.com/users/adoroszlai/events{/privacy}","received_events_url":"https://api.github.com/users/adoroszlai/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\nImplement cluster creation using mpacks specified in the cluster creation request (as well as those in the blueprint).\r\n\r\nBlueprint may no longer know about services and other information defined in the stacks, so several service-related methods had to be moved out, and most of blueprint validation had to be moved to the `TopologyValidator` framework.  A new `ResolvedComponent` was introduced, which combines user-specified information with those looked up from the mpacks.  It is created by the `ComponentResolver`, which encapsulates the logic for stack lookups, defaults for unspecified items, etc.\r\n\r\nOther improvements, cleanups:\r\n\r\n * Moved settings-related methods to `Setting` to avoid cluttering the `Blueprint` interface.\r\n * Eliminated static injection in `BlueprintFactory`\r\n * Reduced code duplication in some cases\r\n\r\nNote: this change adds a compile-time-only dependency on [FreeBuilder](http://freebuilder.inferred.org/), an [Apache 2.0-licenced](https://github.com/inferred/FreeBuilder/blob/master/LICENSE.txt) code generation library.  It needs a bit of setup in IDEs, but there are instructions for both [Eclipse](https://github.com/inferred/FreeBuilder#eclipse) and [IntelliJ IDEA](https://github.com/inferred/FreeBuilder#intellij).\r\n\r\n## How was this patch tested?\r\n\r\nInstalled cluster via blueprint using new HDPCORE mpack.\r\n\r\nTopology-related unit tests are no worse than before.","created_at":"2018-02-22T17:18:34Z","updated_at":"2018-02-23T14:04:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7fb89f2ec11e5a2ecc9db1aaf1db99343aaf53d","assignee":{"login":"adoroszlai","id":6454655,"avatar_url":"https://avatars2.githubusercontent.com/u/6454655?v=4","gravatar_id":"","url":"https://api.github.com/users/adoroszlai","html_url":"https://github.com/adoroszlai","followers_url":"https://api.github.com/users/adoroszlai/followers","following_url":"https://api.github.com/users/adoroszlai/following{/other_user}","gists_url":"https://api.github.com/users/adoroszlai/gists{/gist_id}","starred_url":"https://api.github.com/users/adoroszlai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adoroszlai/subscriptions","organizations_url":"https://api.github.com/users/adoroszlai/orgs","repos_url":"https://api.github.com/users/adoroszlai/repos","events_url":"https://api.github.com/users/adoroszlai/events{/privacy}","received_events_url":"https://api.github.com/users/adoroszlai/received_events","type":"User","site_admin":false},"assignees":[{"login":"adoroszlai","id":6454655,"avatar_url":"https://avatars2.githubusercontent.com/u/6454655?v=4","gravatar_id":"","url":"https://api.github.com/users/adoroszlai","html_url":"https://github.com/adoroszlai","followers_url":"https://api.github.com/users/adoroszlai/followers","following_url":"https://api.github.com/users/adoroszlai/following{/other_user}","gists_url":"https://api.github.com/users/adoroszlai/gists{/gist_id}","starred_url":"https://api.github.com/users/adoroszlai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adoroszlai/subscriptions","organizations_url":"https://api.github.com/users/adoroszlai/orgs","repos_url":"https://api.github.com/users/adoroszlai/repos","events_url":"https://api.github.com/users/adoroszlai/events{/privacy}","received_events_url":"https://api.github.com/users/adoroszlai/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"jayush","id":2170665,"avatar_url":"https://avatars2.githubusercontent.com/u/2170665?v=4","gravatar_id":"","url":"https://api.github.com/users/jayush","html_url":"https://github.com/jayush","followers_url":"https://api.github.com/users/jayush/followers","following_url":"https://api.github.com/users/jayush/following{/other_user}","gists_url":"https://api.github.com/users/jayush/gists{/gist_id}","starred_url":"https://api.github.com/users/jayush/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayush/subscriptions","organizations_url":"https://api.github.com/users/jayush/orgs","repos_url":"https://api.github.com/users/jayush/repos","events_url":"https://api.github.com/users/jayush/events{/privacy}","received_events_url":"https://api.github.com/users/jayush/received_events","type":"User","site_admin":false},{"login":"rnettleton","id":6032105,"avatar_url":"https://avatars0.githubusercontent.com/u/6032105?v=4","gravatar_id":"","url":"https://api.github.com/users/rnettleton","html_url":"https://github.com/rnettleton","followers_url":"https://api.github.com/users/rnettleton/followers","following_url":"https://api.github.com/users/rnettleton/following{/other_user}","gists_url":"https://api.github.com/users/rnettleton/gists{/gist_id}","starred_url":"https://api.github.com/users/rnettleton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnettleton/subscriptions","organizations_url":"https://api.github.com/users/rnettleton/orgs","repos_url":"https://api.github.com/users/rnettleton/repos","events_url":"https://api.github.com/users/rnettleton/events{/privacy}","received_events_url":"https://api.github.com/users/rnettleton/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":801664777,"url":"https://api.github.com/repos/apache/ambari/labels/blueprint","name":"blueprint","color":"0052cc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/apache/ambari/pulls/444/commits","review_comments_url":"https://api.github.com/repos/apache/ambari/pulls/444/comments","review_comment_url":"https://api.github.com/repos/apache/ambari/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/ambari/issues/444/comments","statuses_url":"https://api.github.com/repos/apache/ambari/statuses/a79dd887db02fb4337ffbe12a361dfa71cbe0abe","head":{"label":"adoroszlai:AMBARI-22875_new_mpacks","ref":"AMBARI-22875_new_mpacks","sha":"a79dd887db02fb4337ffbe12a361dfa71cbe0abe","user":{"login":"adoroszlai","id":6454655,"avatar_url":"https://avatars2.githubusercontent.com/u/6454655?v=4","gravatar_id":"","url":"https://api.github.com/users/adoroszlai","html_url":"https://github.com/adoroszlai","followers_url":"https://api.github.com/users/adoroszlai/followers","following_url":"https://api.github.com/users/adoroszlai/following{/other_user}","gists_url":"https://api.github.com/users/adoroszlai/gists{/gist_id}","starred_url":"https://api.github.com/users/adoroszlai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adoroszlai/subscriptions","organizations_url":"https://api.github.com/users/adoroszlai/orgs","repos_url":"https://api.github.com/users/adoroszlai/repos","events_url":"https://api.github.com/users/adoroszlai/events{/privacy}","received_events_url":"https://api.github.com/users/adoroszlai/received_events","type":"User","site_admin":false},"repo":{"id":116725725,"name":"ambari","full_name":"adoroszlai/ambari","owner":{"login":"adoroszlai","id":6454655,"avatar_url":"https://avatars2.githubusercontent.com/u/6454655?v=4","gravatar_id":"","url":"https://api.github.com/users/adoroszlai","html_url":"https://github.com/adoroszlai","followers_url":"https://api.github.com/users/adoroszlai/followers","following_url":"https://api.github.com/users/adoroszlai/following{/other_user}","gists_url":"https://api.github.com/users/adoroszlai/gists{/gist_id}","starred_url":"https://api.github.com/users/adoroszlai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adoroszlai/subscriptions","organizations_url":"https://api.github.com/users/adoroszlai/orgs","repos_url":"https://api.github.com/users/adoroszlai/repos","events_url":"https://api.github.com/users/adoroszlai/events{/privacy}","received_events_url":"https://api.github.com/users/adoroszlai/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adoroszlai/ambari","description":"Mirror of Apache Ambari","fork":true,"url":"https://api.github.com/repos/adoroszlai/ambari","forks_url":"https://api.github.com/repos/adoroszlai/ambari/forks","keys_url":"https://api.github.com/repos/adoroszlai/ambari/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adoroszlai/ambari/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adoroszlai/ambari/teams","hooks_url":"https://api.github.com/repos/adoroszlai/ambari/hooks","issue_events_url":"https://api.github.com/repos/adoroszlai/ambari/issues/events{/number}","events_url":"https://api.github.com/repos/adoroszlai/ambari/events","assignees_url":"https://api.github.com/repos/adoroszlai/ambari/assignees{/user}","branches_url":"https://api.github.com/repos/adoroszlai/ambari/branches{/branch}","tags_url":"https://api.github.com/repos/adoroszlai/ambari/tags","blobs_url":"https://api.github.com/repos/adoroszlai/ambari/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adoroszlai/ambari/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adoroszlai/ambari/git/refs{/sha}","trees_url":"https://api.github.com/repos/adoroszlai/ambari/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adoroszlai/ambari/statuses/{sha}","languages_url":"https://api.github.com/repos/adoroszlai/ambari/languages","stargazers_url":"https://api.github.com/repos/adoroszlai/ambari/stargazers","contributors_url":"https://api.github.com/repos/adoroszlai/ambari/contributors","subscribers_url":"https://api.github.com/repos/adoroszlai/ambari/subscribers","subscription_url":"https://api.github.com/repos/adoroszlai/ambari/subscription","commits_url":"https://api.github.com/repos/adoroszlai/ambari/commits{/sha}","git_commits_url":"https://api.github.com/repos/adoroszlai/ambari/git/commits{/sha}","comments_url":"https://api.github.com/repos/adoroszlai/ambari/comments{/number}","issue_comment_url":"https://api.github.com/repos/adoroszlai/ambari/issues/comments{/number}","contents_url":"https://api.github.com/repos/adoroszlai/ambari/contents/{+path}","compare_url":"https://api.github.com/repos/adoroszlai/ambari/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adoroszlai/ambari/merges","archive_url":"https://api.github.com/repos/adoroszlai/ambari/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adoroszlai/ambari/downloads","issues_url":"https://api.github.com/repos/adoroszlai/ambari/issues{/number}","pulls_url":"https://api.github.com/repos/adoroszlai/ambari/pulls{/number}","milestones_url":"https://api.github.com/repos/adoroszlai/ambari/milestones{/number}","notifications_url":"https://api.github.com/repos/adoroszlai/ambari/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adoroszlai/ambari/labels{/name}","releases_url":"https://api.github.com/repos/adoroszlai/ambari/releases{/id}","deployments_url":"https://api.github.com/repos/adoroszlai/ambari/deployments","created_at":"2018-01-08T20:41:39Z","updated_at":"2018-01-08T20:42:26Z","pushed_at":"2018-02-23T12:39:53Z","git_url":"git://github.com/adoroszlai/ambari.git","ssh_url":"git@github.com:adoroszlai/ambari.git","clone_url":"https://github.com/adoroszlai/ambari.git","svn_url":"https://github.com/adoroszlai/ambari","homepage":null,"size":307380,"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":"trunk"}},"base":{"label":"apache:branch-feature-AMBARI-14714","ref":"branch-feature-AMBARI-14714","sha":"396e488c5493e906db1d8d49a1fc08e18cd8d5d7","user":{"login":"apache","id":47359,"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":2442457,"name":"ambari","full_name":"apache/ambari","owner":{"login":"apache","id":47359,"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},"private":false,"html_url":"https://github.com/apache/ambari","description":"Mirror of Apache Ambari","fork":false,"url":"https://api.github.com/repos/apache/ambari","forks_url":"https://api.github.com/repos/apache/ambari/forks","keys_url":"https://api.github.com/repos/apache/ambari/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/ambari/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/ambari/teams","hooks_url":"https://api.github.com/repos/apache/ambari/hooks","issue_events_url":"https://api.github.com/repos/apache/ambari/issues/events{/number}","events_url":"https://api.github.com/repos/apache/ambari/events","assignees_url":"https://api.github.com/repos/apache/ambari/assignees{/user}","branches_url":"https://api.github.com/repos/apache/ambari/branches{/branch}","tags_url":"https://api.github.com/repos/apache/ambari/tags","blobs_url":"https://api.github.com/repos/apache/ambari/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/ambari/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/ambari/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/ambari/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/ambari/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/ambari/languages","stargazers_url":"https://api.github.com/repos/apache/ambari/stargazers","contributors_url":"https://api.github.com/repos/apache/ambari/contributors","subscribers_url":"https://api.github.com/repos/apache/ambari/subscribers","subscription_url":"https://api.github.com/repos/apache/ambari/subscription","commits_url":"https://api.github.com/repos/apache/ambari/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/ambari/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/ambari/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/ambari/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/ambari/contents/{+path}","compare_url":"https://api.github.com/repos/apache/ambari/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/ambari/merges","archive_url":"https://api.github.com/repos/apache/ambari/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/ambari/downloads","issues_url":"https://api.github.com/repos/apache/ambari/issues{/number}","pulls_url":"https://api.github.com/repos/apache/ambari/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/ambari/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/ambari/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/ambari/labels{/name}","releases_url":"https://api.github.com/repos/apache/ambari/releases{/id}","deployments_url":"https://api.github.com/repos/apache/ambari/deployments","created_at":"2011-09-23T07:00:08Z","updated_at":"2018-02-20T14:31:14Z","pushed_at":"2018-02-23T13:11:12Z","git_url":"git://github.com/apache/ambari.git","ssh_url":"git@github.com:apache/ambari.git","clone_url":"https://github.com/apache/ambari.git","svn_url":"https://github.com/apache/ambari","homepage":null,"size":312018,"stargazers_count":776,"watchers_count":776,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":808,"mirror_url":null,"archived":false,"open_issues_count":48,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":808,"open_issues":48,"watchers":776,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/ambari/pulls/444"},"html":{"href":"https://github.com/apache/ambari/pull/444"},"issue":{"href":"https://api.github.com/repos/apache/ambari/issues/444"},"comments":{"href":"https://api.github.com/repos/apache/ambari/issues/444/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/ambari/pulls/444/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/ambari/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/ambari/pulls/444/commits"},"statuses":{"href":"https://api.github.com/repos/apache/ambari/statuses/a79dd887db02fb4337ffbe12a361dfa71cbe0abe"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"adoroszlai"}}