{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/180575623","pull_request_review_id":111010193,"id":180575623,"diff_hunk":"@@ -358,22 +420,40 @@ public void writeAsText(final String filePath,\n         for (final Predicate<? super K, ? super V> predicate : predicates) {\n             Objects.requireNonNull(predicate, \"predicates can't have null values\");\n         }\n+        final String branchName = builder.newProcessorName(BRANCH_NAME);\n+        final String[] childNames = new String[predicates.length];\n+        final List<StreamsGraphNode> branchChildNodes = new ArrayList<>();\n \n-        String branchName = builder.newProcessorName(BRANCH_NAME);\n-\n-        String[] childNames = new String[predicates.length];\n+        KStream<K, V>[] branchChildren = (KStream<K, V>[]) Array.newInstance(KStream.class, predicates.length);","path":"streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamImpl.java","position":196,"original_position":196,"commit_id":"dda3a2d57950036bbf8304c4e046137b9559d378","original_commit_id":"dda3a2d57950036bbf8304c4e046137b9559d378","user":{"login":"vvcephei","id":832787,"avatar_url":"https://avatars0.githubusercontent.com/u/832787?v=4","gravatar_id":"","url":"https://api.github.com/users/vvcephei","html_url":"https://github.com/vvcephei","followers_url":"https://api.github.com/users/vvcephei/followers","following_url":"https://api.github.com/users/vvcephei/following{/other_user}","gists_url":"https://api.github.com/users/vvcephei/gists{/gist_id}","starred_url":"https://api.github.com/users/vvcephei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvcephei/subscriptions","organizations_url":"https://api.github.com/users/vvcephei/orgs","repos_url":"https://api.github.com/users/vvcephei/repos","events_url":"https://api.github.com/users/vvcephei/events{/privacy}","received_events_url":"https://api.github.com/users/vvcephei/received_events","type":"User","site_admin":false},"body":"nit: can be final.","created_at":"2018-04-10T21:37:54Z","updated_at":"2018-04-10T22:00:17Z","html_url":"https://github.com/apache/kafka/pull/4654#discussion_r180575623","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/4654","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/180575623"},"html":{"href":"https://github.com/apache/kafka/pull/4654#discussion_r180575623"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/4654"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/4654","id":173237417,"html_url":"https://github.com/apache/kafka/pull/4654","diff_url":"https://github.com/apache/kafka/pull/4654.diff","patch_url":"https://github.com/apache/kafka/pull/4654.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/4654","number":4654,"state":"open","locked":false,"title":"KAFKA-6761: Reduce Kafka Streams Footprint","user":{"login":"bbejeck","id":199238,"avatar_url":"https://avatars3.githubusercontent.com/u/199238?v=4","gravatar_id":"","url":"https://api.github.com/users/bbejeck","html_url":"https://github.com/bbejeck","followers_url":"https://api.github.com/users/bbejeck/followers","following_url":"https://api.github.com/users/bbejeck/following{/other_user}","gists_url":"https://api.github.com/users/bbejeck/gists{/gist_id}","starred_url":"https://api.github.com/users/bbejeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbejeck/subscriptions","organizations_url":"https://api.github.com/users/bbejeck/orgs","repos_url":"https://api.github.com/users/bbejeck/repos","events_url":"https://api.github.com/users/bbejeck/events{/privacy}","received_events_url":"https://api.github.com/users/bbejeck/received_events","type":"User","site_admin":false},"body":"This PR is the first pass on the topology optimization effort. Here's a guide to the changes and the order of the list is meant to imply a possible review order.  \r\n\r\n1. `StreamsTopolgyGraphImpl` - This class is used to build the graph, record any metadata to be used later during the topology building process. Some stubbed out code to that end is already present\r\n2. `TopologyOptimizerImpl` - This class traverses the graph and uses information contained in a `StreamGraphNode` to make calls to the `InternalTopologyBuilder` to construct the topology.  It's at this point any optimizations will be applied.\r\n3. `StreamsBuilder` -  The `StreamsBuilder#build` method has been modified to call `InternalStreamdBuilder#buildAndOptimize` to build topology.\r\n4. `InternalStreamsBuilder` - Contains a reference to the `StreamsTopologyGraph` added a methods `InternalStreamsBuilder#addNode`  and `InternalStreamsBuilder#buildAndOptimize` `InternalStreamsBuilder` is the only intermediary for building the graph from the DSL.\r\n5. `KStreamImpl`, `KTableImpl`, `KGroupedStream` and `KGroupedTable` and others have been refactored to create `StreamGraphNode` instances and place topology information in the graph vs. calling `InternalTopologyBuilder`.\r\n6. `StreamsGraphNode` and sub-classes are used to contain information from the DSL calls.  IMHO this is the part of the PR so far that needs the most refactoring work from me, but these are merely container objects so the refactoring should be straightforward.  I plan on updating the PR with updates to these classes soon.\r\n\r\nSome other notes:\r\n1. I have not added units test for the new code (will be added soon).  But IMHO the fact that the framework is used to handle all DSL operations, I feel that all of our current tests passing suffice for the moment.\r\n2. Due to depreciation, I have not included the `KStreamsBuilder` in this initial PR.  I can do so, but I think this takes us a step backward regarding separation of DSL and PAPI.\r\n\r\n### Committer Checklist (excluded from commit message)\r\n- [ ] Verify design and implementation \r\n- [ ] Verify test coverage and CI build status\r\n- [ ] Verify documentation (including upgrade notes)\r\n","created_at":"2018-03-06T18:05:08Z","updated_at":"2018-04-10T22:00:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03930cd45382bb909acb20730cf3c5d9e5cba901","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":820747028,"url":"https://api.github.com/repos/apache/kafka/labels/streams","name":"streams","color":"63edea","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/4654/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/4654/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/4654/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/dda3a2d57950036bbf8304c4e046137b9559d378","head":{"label":"bbejeck:KSTREAMS-1304_initial_pass_on_optimization","ref":"KSTREAMS-1304_initial_pass_on_optimization","sha":"dda3a2d57950036bbf8304c4e046137b9559d378","user":{"login":"bbejeck","id":199238,"avatar_url":"https://avatars3.githubusercontent.com/u/199238?v=4","gravatar_id":"","url":"https://api.github.com/users/bbejeck","html_url":"https://github.com/bbejeck","followers_url":"https://api.github.com/users/bbejeck/followers","following_url":"https://api.github.com/users/bbejeck/following{/other_user}","gists_url":"https://api.github.com/users/bbejeck/gists{/gist_id}","starred_url":"https://api.github.com/users/bbejeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbejeck/subscriptions","organizations_url":"https://api.github.com/users/bbejeck/orgs","repos_url":"https://api.github.com/users/bbejeck/repos","events_url":"https://api.github.com/users/bbejeck/events{/privacy}","received_events_url":"https://api.github.com/users/bbejeck/received_events","type":"User","site_admin":false},"repo":{"id":42054236,"name":"kafka","full_name":"bbejeck/kafka","owner":{"login":"bbejeck","id":199238,"avatar_url":"https://avatars3.githubusercontent.com/u/199238?v=4","gravatar_id":"","url":"https://api.github.com/users/bbejeck","html_url":"https://github.com/bbejeck","followers_url":"https://api.github.com/users/bbejeck/followers","following_url":"https://api.github.com/users/bbejeck/following{/other_user}","gists_url":"https://api.github.com/users/bbejeck/gists{/gist_id}","starred_url":"https://api.github.com/users/bbejeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbejeck/subscriptions","organizations_url":"https://api.github.com/users/bbejeck/orgs","repos_url":"https://api.github.com/users/bbejeck/repos","events_url":"https://api.github.com/users/bbejeck/events{/privacy}","received_events_url":"https://api.github.com/users/bbejeck/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bbejeck/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/bbejeck/kafka","forks_url":"https://api.github.com/repos/bbejeck/kafka/forks","keys_url":"https://api.github.com/repos/bbejeck/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bbejeck/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bbejeck/kafka/teams","hooks_url":"https://api.github.com/repos/bbejeck/kafka/hooks","issue_events_url":"https://api.github.com/repos/bbejeck/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/bbejeck/kafka/events","assignees_url":"https://api.github.com/repos/bbejeck/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/bbejeck/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/bbejeck/kafka/tags","blobs_url":"https://api.github.com/repos/bbejeck/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bbejeck/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bbejeck/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/bbejeck/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bbejeck/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/bbejeck/kafka/languages","stargazers_url":"https://api.github.com/repos/bbejeck/kafka/stargazers","contributors_url":"https://api.github.com/repos/bbejeck/kafka/contributors","subscribers_url":"https://api.github.com/repos/bbejeck/kafka/subscribers","subscription_url":"https://api.github.com/repos/bbejeck/kafka/subscription","commits_url":"https://api.github.com/repos/bbejeck/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/bbejeck/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/bbejeck/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/bbejeck/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/bbejeck/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/bbejeck/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bbejeck/kafka/merges","archive_url":"https://api.github.com/repos/bbejeck/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bbejeck/kafka/downloads","issues_url":"https://api.github.com/repos/bbejeck/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/bbejeck/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/bbejeck/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/bbejeck/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bbejeck/kafka/labels{/name}","releases_url":"https://api.github.com/repos/bbejeck/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/bbejeck/kafka/deployments","created_at":"2015-09-07T13:23:16Z","updated_at":"2018-04-09T13:16:30Z","pushed_at":"2018-04-10T16:37:37Z","git_url":"git://github.com/bbejeck/kafka.git","ssh_url":"git@github.com:bbejeck/kafka.git","clone_url":"https://github.com/bbejeck/kafka.git","svn_url":"https://github.com/bbejeck/kafka","homepage":null,"size":61685,"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":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"ac542c9a835d3a2dd46f37712c6b5438f56747c0","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":2211243,"name":"kafka","full_name":"apache/kafka","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/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}","deployments_url":"https://api.github.com/repos/apache/kafka/deployments","created_at":"2011-08-15T18:06:16Z","updated_at":"2018-04-10T19:50:11Z","pushed_at":"2018-04-10T21:38:41Z","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":64272,"stargazers_count":7944,"watchers_count":7944,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4693,"mirror_url":null,"archived":false,"open_issues_count":443,"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":4693,"open_issues":443,"watchers":7944,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/4654"},"html":{"href":"https://github.com/apache/kafka/pull/4654"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/4654"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/4654/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/4654/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/4654/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/dda3a2d57950036bbf8304c4e046137b9559d378"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vvcephei"}}