{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/70990267","id":70990267,"diff_hunk":"@@ -59,4 +78,78 @@ public SourceNode source(String topic) {\n         return stateStoreSuppliers;\n     }\n \n+\n+    /**\n+     * Produces a string representation contain useful information about a ProcessorTopology.\n+     * This is useful in debugging scenarios. Prints graph by performing a breadth-first search starting\n+     * from source nodes\n+     * @return A string representation of the ProcessorTopology instance.\n+     */\n+    public String toString() {\n+        Map<String, Boolean> visitedNode = new HashMap<String, Boolean>();\n+        Queue queue = new LinkedList();\n+        String processorTopologyString = \"ProcessorTopology[\";\n+        Set<SourceNode> tmpSources = sources();\n+\n+        // pre-process source nodes to get reverse mapping\n+        Map<String, String> sourceNameToTopic = new HashMap<>();\n+        for (String topic : sourceByTopics.keySet()) {\n+            SourceNode source = sourceByTopics.get(topic);\n+            sourceNameToTopic.put(source.name(), topic);\n+        }\n+\n+        // pre-process sink nodes to get reverse mapping\n+        Map<String, String> sinkNameToTopic = new HashMap<>();\n+        for (String topic : sinkByTopics.keySet()) {\n+            SinkNode sink = sinkByTopics.get(topic);\n+            sinkNameToTopic.put(sink.name(), topic);\n+        }\n+\n+        // add all sources to a queue for Breadth-First traversal\n+        if (tmpSources != null) {\n+            // add all sources\n+            for (String topic : sourceByTopics.keySet()) {\n+                SourceNode source = sourceByTopics.get(topic);\n+                // mark as visited\n+                visitedNode.put(source.name(), true);\n+                // put in queue\n+                queue.add(source);\n+            }\n+\n+            // iterate to next level","path":"streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorTopology.java","position":96,"original_position":96,"commit_id":"656116addce7b4d0d6f44e3a3d3907f6eb989b65","original_commit_id":"2d9aff3c5dcd26b50be7c51992bbf5be20902840","user":{"login":"enothereska","id":14234336,"avatar_url":"https://avatars.githubusercontent.com/u/14234336?v=3","gravatar_id":"","url":"https://api.github.com/users/enothereska","html_url":"https://github.com/enothereska","followers_url":"https://api.github.com/users/enothereska/followers","following_url":"https://api.github.com/users/enothereska/following{/other_user}","gists_url":"https://api.github.com/users/enothereska/gists{/gist_id}","starred_url":"https://api.github.com/users/enothereska/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enothereska/subscriptions","organizations_url":"https://api.github.com/users/enothereska/orgs","repos_url":"https://api.github.com/users/enothereska/repos","events_url":"https://api.github.com/users/enothereska/events{/privacy}","received_events_url":"https://api.github.com/users/enothereska/received_events","type":"User","site_admin":false},"body":"Yeah I know. The alternative is to print the same node multiple times. Perhaps @theduderog can adjust the printing to see what's most useful in practice when debugging?","created_at":"2016-07-15T15:19:11Z","updated_at":"2016-07-15T15:19:11Z","html_url":"https://github.com/apache/kafka/pull/1619#discussion_r70990267","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/1619","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/70990267"},"html":{"href":"https://github.com/apache/kafka/pull/1619#discussion_r70990267"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/1619"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/1619","id":77302176,"html_url":"https://github.com/apache/kafka/pull/1619","diff_url":"https://github.com/apache/kafka/pull/1619.diff","patch_url":"https://github.com/apache/kafka/pull/1619.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/1619","number":1619,"state":"open","locked":false,"title":"KAFKA-3858: Add functions to print stream topologies","user":{"login":"enothereska","id":14234336,"avatar_url":"https://avatars.githubusercontent.com/u/14234336?v=3","gravatar_id":"","url":"https://api.github.com/users/enothereska","html_url":"https://github.com/enothereska","followers_url":"https://api.github.com/users/enothereska/followers","following_url":"https://api.github.com/users/enothereska/following{/other_user}","gists_url":"https://api.github.com/users/enothereska/gists{/gist_id}","starred_url":"https://api.github.com/users/enothereska/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enothereska/subscriptions","organizations_url":"https://api.github.com/users/enothereska/orgs","repos_url":"https://api.github.com/users/enothereska/repos","events_url":"https://api.github.com/users/enothereska/events{/privacy}","received_events_url":"https://api.github.com/users/enothereska/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-13T14:47:33Z","updated_at":"2016-07-15T15:19:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f8214c50e1f679222777557c77c1fd01ab7fafb1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/1619/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/1619/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/1619/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/656116addce7b4d0d6f44e3a3d3907f6eb989b65","head":{"label":"enothereska:KAFKA-3858-print-topology","ref":"KAFKA-3858-print-topology","sha":"656116addce7b4d0d6f44e3a3d3907f6eb989b65","user":{"login":"enothereska","id":14234336,"avatar_url":"https://avatars.githubusercontent.com/u/14234336?v=3","gravatar_id":"","url":"https://api.github.com/users/enothereska","html_url":"https://github.com/enothereska","followers_url":"https://api.github.com/users/enothereska/followers","following_url":"https://api.github.com/users/enothereska/following{/other_user}","gists_url":"https://api.github.com/users/enothereska/gists{/gist_id}","starred_url":"https://api.github.com/users/enothereska/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enothereska/subscriptions","organizations_url":"https://api.github.com/users/enothereska/orgs","repos_url":"https://api.github.com/users/enothereska/repos","events_url":"https://api.github.com/users/enothereska/events{/privacy}","received_events_url":"https://api.github.com/users/enothereska/received_events","type":"User","site_admin":false},"repo":{"id":44994140,"name":"kafka","full_name":"enothereska/kafka","owner":{"login":"enothereska","id":14234336,"avatar_url":"https://avatars.githubusercontent.com/u/14234336?v=3","gravatar_id":"","url":"https://api.github.com/users/enothereska","html_url":"https://github.com/enothereska","followers_url":"https://api.github.com/users/enothereska/followers","following_url":"https://api.github.com/users/enothereska/following{/other_user}","gists_url":"https://api.github.com/users/enothereska/gists{/gist_id}","starred_url":"https://api.github.com/users/enothereska/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enothereska/subscriptions","organizations_url":"https://api.github.com/users/enothereska/orgs","repos_url":"https://api.github.com/users/enothereska/repos","events_url":"https://api.github.com/users/enothereska/events{/privacy}","received_events_url":"https://api.github.com/users/enothereska/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/enothereska/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/enothereska/kafka","forks_url":"https://api.github.com/repos/enothereska/kafka/forks","keys_url":"https://api.github.com/repos/enothereska/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enothereska/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enothereska/kafka/teams","hooks_url":"https://api.github.com/repos/enothereska/kafka/hooks","issue_events_url":"https://api.github.com/repos/enothereska/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/enothereska/kafka/events","assignees_url":"https://api.github.com/repos/enothereska/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/enothereska/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/enothereska/kafka/tags","blobs_url":"https://api.github.com/repos/enothereska/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enothereska/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enothereska/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/enothereska/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enothereska/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/enothereska/kafka/languages","stargazers_url":"https://api.github.com/repos/enothereska/kafka/stargazers","contributors_url":"https://api.github.com/repos/enothereska/kafka/contributors","subscribers_url":"https://api.github.com/repos/enothereska/kafka/subscribers","subscription_url":"https://api.github.com/repos/enothereska/kafka/subscription","commits_url":"https://api.github.com/repos/enothereska/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/enothereska/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/enothereska/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/enothereska/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/enothereska/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/enothereska/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enothereska/kafka/merges","archive_url":"https://api.github.com/repos/enothereska/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enothereska/kafka/downloads","issues_url":"https://api.github.com/repos/enothereska/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/enothereska/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/enothereska/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/enothereska/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enothereska/kafka/labels{/name}","releases_url":"https://api.github.com/repos/enothereska/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/enothereska/kafka/deployments","created_at":"2015-10-26T20:08:13Z","updated_at":"2016-01-28T16:05:20Z","pushed_at":"2016-07-15T15:16:49Z","git_url":"git://github.com/enothereska/kafka.git","ssh_url":"git@github.com:enothereska/kafka.git","clone_url":"https://github.com/enothereska/kafka.git","svn_url":"https://github.com/enothereska/kafka","homepage":null,"size":32306,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"9f94a7752a590c36186a7eb1eee16e992ec68c97","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}","deployments_url":"https://api.github.com/repos/apache/kafka/deployments","created_at":"2011-08-15T18:06:16Z","updated_at":"2016-07-15T14:58:28Z","pushed_at":"2016-07-15T15:16:49Z","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":45601,"stargazers_count":3441,"watchers_count":3441,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2115,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":216,"forks":2115,"open_issues":216,"watchers":3441,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/1619"},"html":{"href":"https://github.com/apache/kafka/pull/1619"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/1619"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/1619/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/1619/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/1619/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/656116addce7b4d0d6f44e3a3d3907f6eb989b65"}}}}
{"actor":{"display_login":"enothereska"}}