{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/42887603","id":42887603,"diff_hunk":"@@ -237,10 +247,79 @@ public final TopologyBuilder addProcessor(String name, ProcessorSupplier supplie\n \n         nodeNames.add(name);\n         nodeFactories.add(new ProcessorNodeFactory(name, parentNames, supplier));\n+        nodeGroups.add(name);\n+        nodeGroups.unite(name, parentNames);\n         return this;\n     }\n \n     /**\n+     * Returns the topic groups.\n+     * A topic group is a group of topics in the same task.\n+     *\n+     * @return groups of topic names\n+     */\n+    public Collection<Set<String>> topicGroups() {","path":"streams/src/main/java/org/apache/kafka/streams/processor/TopologyBuilder.java","position":57,"original_position":57,"commit_id":"5119b78faef082a5702276f39b401980275c1c94","original_commit_id":"98f3bcc1896fd159ccbbd37fc65b1d9d6f568bb9","user":{"login":"ymatsuda","id":169548,"avatar_url":"https://avatars.githubusercontent.com/u/169548?v=3","gravatar_id":"","url":"https://api.github.com/users/ymatsuda","html_url":"https://github.com/ymatsuda","followers_url":"https://api.github.com/users/ymatsuda/followers","following_url":"https://api.github.com/users/ymatsuda/following{/other_user}","gists_url":"https://api.github.com/users/ymatsuda/gists{/gist_id}","starred_url":"https://api.github.com/users/ymatsuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymatsuda/subscriptions","organizations_url":"https://api.github.com/users/ymatsuda/orgs","repos_url":"https://api.github.com/users/ymatsuda/repos","events_url":"https://api.github.com/users/ymatsuda/events{/privacy}","received_events_url":"https://api.github.com/users/ymatsuda/received_events","type":"User","site_admin":false},"body":"I think it is difficult consolidate them since they are at different levels of grouping.","created_at":"2015-10-23T16:54:19Z","updated_at":"2015-10-23T16:54:19Z","html_url":"https://github.com/apache/kafka/pull/353#discussion_r42887603","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/353","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/42887603"},"html":{"href":"https://github.com/apache/kafka/pull/353#discussion_r42887603"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/353"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/353","id":48499183,"html_url":"https://github.com/apache/kafka/pull/353","diff_url":"https://github.com/apache/kafka/pull/353.diff","patch_url":"https://github.com/apache/kafka/pull/353.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/353","number":353,"state":"open","locked":false,"title":"KAFKA-2652: integrate new group protocol into partition grouping","user":{"login":"ymatsuda","id":169548,"avatar_url":"https://avatars.githubusercontent.com/u/169548?v=3","gravatar_id":"","url":"https://api.github.com/users/ymatsuda","html_url":"https://github.com/ymatsuda","followers_url":"https://api.github.com/users/ymatsuda/followers","following_url":"https://api.github.com/users/ymatsuda/following{/other_user}","gists_url":"https://api.github.com/users/ymatsuda/gists{/gist_id}","starred_url":"https://api.github.com/users/ymatsuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymatsuda/subscriptions","organizations_url":"https://api.github.com/users/ymatsuda/orgs","repos_url":"https://api.github.com/users/ymatsuda/repos","events_url":"https://api.github.com/users/ymatsuda/events{/privacy}","received_events_url":"https://api.github.com/users/ymatsuda/received_events","type":"User","site_admin":false},"body":"@guozhangwang \r\n\r\n* added ```PartitionGrouper``` (abstract class)\r\n * This class is responsible for grouping partitions to form tasks.\r\n * Users may implement this class for custom grouping.\r\n* added ```DefaultPartitionGrouper```\r\n * our default implementation of ```PartitionGrouper```\r\n* added ```KafkaStreamingPartitionAssignor```\r\n * We always use this as ```PartitionAssignor``` of stream consumers.\r\n * Actual grouping is delegated to ```PartitionGrouper```.\r\n* ```TopologyBuilder```\r\n * added ```topicGroups()```\r\n   * This returns groups of related topics according to the topology\r\n * added ```copartitionSources(sourceNodes...)```\r\n   * This is used by DSL layer. It asserts the specified source nodes must be copartitioned.\r\n * added ```copartitionGroups()```\r\n   * This returns groups of copartitioned topics\r\n* KStream layer\r\n * keep track of source nodes to determine copartition sources when steams are joined\r\n * source nodes are set to null when partitioning property is not preserved (ex. ```map()```, ```transform()```), and this indicates the stream is no longer joinable\r\n","created_at":"2015-10-22T19:08:44Z","updated_at":"2015-10-23T16:54:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e9b225108dbcb47d2ffb2ceed81ffa66cab482af","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/353/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/353/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/353/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/5119b78faef082a5702276f39b401980275c1c94","head":{"label":"ymatsuda:grouping","ref":"grouping","sha":"5119b78faef082a5702276f39b401980275c1c94","user":{"login":"ymatsuda","id":169548,"avatar_url":"https://avatars.githubusercontent.com/u/169548?v=3","gravatar_id":"","url":"https://api.github.com/users/ymatsuda","html_url":"https://github.com/ymatsuda","followers_url":"https://api.github.com/users/ymatsuda/followers","following_url":"https://api.github.com/users/ymatsuda/following{/other_user}","gists_url":"https://api.github.com/users/ymatsuda/gists{/gist_id}","starred_url":"https://api.github.com/users/ymatsuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymatsuda/subscriptions","organizations_url":"https://api.github.com/users/ymatsuda/orgs","repos_url":"https://api.github.com/users/ymatsuda/repos","events_url":"https://api.github.com/users/ymatsuda/events{/privacy}","received_events_url":"https://api.github.com/users/ymatsuda/received_events","type":"User","site_admin":false},"repo":{"id":30946235,"name":"kafka","full_name":"ymatsuda/kafka","owner":{"login":"ymatsuda","id":169548,"avatar_url":"https://avatars.githubusercontent.com/u/169548?v=3","gravatar_id":"","url":"https://api.github.com/users/ymatsuda","html_url":"https://github.com/ymatsuda","followers_url":"https://api.github.com/users/ymatsuda/followers","following_url":"https://api.github.com/users/ymatsuda/following{/other_user}","gists_url":"https://api.github.com/users/ymatsuda/gists{/gist_id}","starred_url":"https://api.github.com/users/ymatsuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymatsuda/subscriptions","organizations_url":"https://api.github.com/users/ymatsuda/orgs","repos_url":"https://api.github.com/users/ymatsuda/repos","events_url":"https://api.github.com/users/ymatsuda/events{/privacy}","received_events_url":"https://api.github.com/users/ymatsuda/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ymatsuda/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/ymatsuda/kafka","forks_url":"https://api.github.com/repos/ymatsuda/kafka/forks","keys_url":"https://api.github.com/repos/ymatsuda/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ymatsuda/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ymatsuda/kafka/teams","hooks_url":"https://api.github.com/repos/ymatsuda/kafka/hooks","issue_events_url":"https://api.github.com/repos/ymatsuda/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/ymatsuda/kafka/events","assignees_url":"https://api.github.com/repos/ymatsuda/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/ymatsuda/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/ymatsuda/kafka/tags","blobs_url":"https://api.github.com/repos/ymatsuda/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ymatsuda/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ymatsuda/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/ymatsuda/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ymatsuda/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/ymatsuda/kafka/languages","stargazers_url":"https://api.github.com/repos/ymatsuda/kafka/stargazers","contributors_url":"https://api.github.com/repos/ymatsuda/kafka/contributors","subscribers_url":"https://api.github.com/repos/ymatsuda/kafka/subscribers","subscription_url":"https://api.github.com/repos/ymatsuda/kafka/subscription","commits_url":"https://api.github.com/repos/ymatsuda/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/ymatsuda/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/ymatsuda/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/ymatsuda/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/ymatsuda/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/ymatsuda/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ymatsuda/kafka/merges","archive_url":"https://api.github.com/repos/ymatsuda/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ymatsuda/kafka/downloads","issues_url":"https://api.github.com/repos/ymatsuda/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/ymatsuda/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/ymatsuda/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/ymatsuda/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ymatsuda/kafka/labels{/name}","releases_url":"https://api.github.com/repos/ymatsuda/kafka/releases{/id}","created_at":"2015-02-18T00:56:44Z","updated_at":"2015-02-18T00:56:46Z","pushed_at":"2015-10-22T22:56:01Z","git_url":"git://github.com/ymatsuda/kafka.git","ssh_url":"git@github.com:ymatsuda/kafka.git","clone_url":"https://github.com/ymatsuda/kafka.git","svn_url":"https://github.com/ymatsuda/kafka","homepage":null,"size":25244,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"0.8.2"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"bf292a6fa5b52844edfe256e8f1dd42da432d0c9","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","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":2211243,"name":"kafka","full_name":"apache/kafka","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","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/kafka","description":"Mirror of Apache Kafka","fork":false,"url":"https://api.github.com/repos/apache/kafka","forks_url":"https://api.github.com/repos/apache/kafka/forks","keys_url":"https://api.github.com/repos/apache/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/kafka/teams","hooks_url":"https://api.github.com/repos/apache/kafka/hooks","issue_events_url":"https://api.github.com/repos/apache/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/apache/kafka/events","assignees_url":"https://api.github.com/repos/apache/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/apache/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/apache/kafka/tags","blobs_url":"https://api.github.com/repos/apache/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/kafka/languages","stargazers_url":"https://api.github.com/repos/apache/kafka/stargazers","contributors_url":"https://api.github.com/repos/apache/kafka/contributors","subscribers_url":"https://api.github.com/repos/apache/kafka/subscribers","subscription_url":"https://api.github.com/repos/apache/kafka/subscription","commits_url":"https://api.github.com/repos/apache/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/apache/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/kafka/merges","archive_url":"https://api.github.com/repos/apache/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/kafka/downloads","issues_url":"https://api.github.com/repos/apache/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/apache/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/kafka/labels{/name}","releases_url":"https://api.github.com/repos/apache/kafka/releases{/id}","created_at":"2011-08-15T18:06:16Z","updated_at":"2015-10-23T10:08:10Z","pushed_at":"2015-10-23T13:00:17Z","git_url":"git://github.com/apache/kafka.git","ssh_url":"git@github.com:apache/kafka.git","clone_url":"https://github.com/apache/kafka.git","svn_url":"https://github.com/apache/kafka","homepage":null,"size":40027,"stargazers_count":2099,"watchers_count":2099,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1243,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":98,"forks":1243,"open_issues":98,"watchers":2099,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/353"},"html":{"href":"https://github.com/apache/kafka/pull/353"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/353"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/353/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/353/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/353/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/5119b78faef082a5702276f39b401980275c1c94"}}}}