{"action":"created","comment":{"url":"https://api.github.com/repos/apache/beam/pulls/comments/191034956","pull_request_review_id":123542117,"id":191034956,"diff_hunk":"@@ -6,31 +6,33 @@\n  * to you under the Apache License, Version 2.0 (the\n  * \"License\"); you may not use this file except in compliance\n  * with the License.  You may obtain a copy of the License at\n- *\n  *     http://www.apache.org/licenses/LICENSE-2.0\n  *\n  * Unless required by applicable law or agreed to in writing, software\n  * distributed under the License is distributed on an \"AS IS\" BASIS,\n  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  * See the License for the specific language governing permissions and\n  * limitations under the License.\n+ *\n  */\n-package org.apache.beam.runners.reference.testing;\n \n-import io.grpc.ManagedChannel;\n-import io.grpc.inprocess.InProcessChannelBuilder;\n-import org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor;\n-import org.apache.beam.sdk.fn.channel.ManagedChannelFactory;\n+package org.apache.beam.fn.harness.control;\n \n-/**\n- * A {@link org.apache.beam.sdk.fn.channel.ManagedChannelFactory} that uses in-process channels.\n- *\n- * <p>The channel builder uses {@link ApiServiceDescriptor#getUrl()} as the unique in-process name.\n- */\n-public class InProcessManagedChannelFactory extends ManagedChannelFactory {\n+import io.grpc.ClientInterceptor;\n+import io.grpc.Metadata;\n+import io.grpc.Metadata.Key;\n+import io.grpc.stub.MetadataUtils;\n+\n+/** A {@link ClientInterceptor} that attaches a provided SDK Harness ID to outgoing messages. */\n+public class AddHarnessIdInterceptor {","path":"sdks/java/harness/src/main/java/org/apache/beam/fn/harness/control/AddHarnessIdInterceptor.java","position":34,"original_position":34,"commit_id":"27c1c8690a4712c6722ba352139ec5e31e3f1240","original_commit_id":"27c1c8690a4712c6722ba352139ec5e31e3f1240","user":{"login":"tgroh","id":429866,"avatar_url":"https://avatars2.githubusercontent.com/u/429866?v=4","gravatar_id":"","url":"https://api.github.com/users/tgroh","html_url":"https://github.com/tgroh","followers_url":"https://api.github.com/users/tgroh/followers","following_url":"https://api.github.com/users/tgroh/following{/other_user}","gists_url":"https://api.github.com/users/tgroh/gists{/gist_id}","starred_url":"https://api.github.com/users/tgroh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgroh/subscriptions","organizations_url":"https://api.github.com/users/tgroh/orgs","repos_url":"https://api.github.com/users/tgroh/repos","events_url":"https://api.github.com/users/tgroh/events{/privacy}","received_events_url":"https://api.github.com/users/tgroh/received_events","type":"User","site_admin":false},"body":"I find this much more readable as a factory method than as an inline key and `MetadataUtils` call - it tells us exactly the thing it does.","created_at":"2018-05-26T00:54:57Z","updated_at":"2018-05-26T00:57:16Z","html_url":"https://github.com/apache/beam/pull/5456#discussion_r191034956","pull_request_url":"https://api.github.com/repos/apache/beam/pulls/5456","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/apache/beam/pulls/comments/191034956"},"html":{"href":"https://github.com/apache/beam/pull/5456#discussion_r191034956"},"pull_request":{"href":"https://api.github.com/repos/apache/beam/pulls/5456"}},"in_reply_to_id":191017563},"pull_request":{"url":"https://api.github.com/repos/apache/beam/pulls/5456","id":190069908,"html_url":"https://github.com/apache/beam/pull/5456","diff_url":"https://github.com/apache/beam/pull/5456.diff","patch_url":"https://github.com/apache/beam/pull/5456.patch","issue_url":"https://api.github.com/repos/apache/beam/issues/5456","number":5456,"state":"open","locked":false,"title":"[BEAM-4145] Populate the worker_id metadata in the Java SDK Harness","user":{"login":"tgroh","id":429866,"avatar_url":"https://avatars2.githubusercontent.com/u/429866?v=4","gravatar_id":"","url":"https://api.github.com/users/tgroh","html_url":"https://github.com/tgroh","followers_url":"https://api.github.com/users/tgroh/followers","following_url":"https://api.github.com/users/tgroh/following{/other_user}","gists_url":"https://api.github.com/users/tgroh/gists{/gist_id}","starred_url":"https://api.github.com/users/tgroh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgroh/subscriptions","organizations_url":"https://api.github.com/users/tgroh/orgs","repos_url":"https://api.github.com/users/tgroh/repos","events_url":"https://api.github.com/users/tgroh/events{/privacy}","received_events_url":"https://api.github.com/users/tgroh/received_events","type":"User","site_admin":false},"body":"The ID is required for any control service with multiple clients, which is the general case.\r\n\r\nEnable `ManagedChannelFactory` implementations to register interceptors on all of the\r\ncreated channels.\r\n\r\nAdd an interceptor which attaches the ID to the metadata. Use this interceptor in the \r\nSdk Harness Control Client.\r\n\r\nPopulate the ID passed via the container contract in the boot go code.\r\n\r\n------------------------\r\n\r\nFollow this checklist to help us incorporate your contribution quickly and easily:\r\n\r\n - [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.\r\n - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).\r\n\r\nIt will help us expedite review of your Pull Request if you tag someone (e.g. `@username`) to look at it.\r\n","created_at":"2018-05-23T18:45:09Z","updated_at":"2018-05-26T00:57:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a6ef973acf0b678c47f41d9ac7435810ec28bd1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/beam/pulls/5456/commits","review_comments_url":"https://api.github.com/repos/apache/beam/pulls/5456/comments","review_comment_url":"https://api.github.com/repos/apache/beam/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/beam/issues/5456/comments","statuses_url":"https://api.github.com/repos/apache/beam/statuses/27c1c8690a4712c6722ba352139ec5e31e3f1240","head":{"label":"tgroh:fn_harness_id","ref":"fn_harness_id","sha":"27c1c8690a4712c6722ba352139ec5e31e3f1240","user":{"login":"tgroh","id":429866,"avatar_url":"https://avatars2.githubusercontent.com/u/429866?v=4","gravatar_id":"","url":"https://api.github.com/users/tgroh","html_url":"https://github.com/tgroh","followers_url":"https://api.github.com/users/tgroh/followers","following_url":"https://api.github.com/users/tgroh/following{/other_user}","gists_url":"https://api.github.com/users/tgroh/gists{/gist_id}","starred_url":"https://api.github.com/users/tgroh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgroh/subscriptions","organizations_url":"https://api.github.com/users/tgroh/orgs","repos_url":"https://api.github.com/users/tgroh/repos","events_url":"https://api.github.com/users/tgroh/events{/privacy}","received_events_url":"https://api.github.com/users/tgroh/received_events","type":"User","site_admin":false},"repo":{"id":52644388,"name":"beam","full_name":"tgroh/beam","owner":{"login":"tgroh","id":429866,"avatar_url":"https://avatars2.githubusercontent.com/u/429866?v=4","gravatar_id":"","url":"https://api.github.com/users/tgroh","html_url":"https://github.com/tgroh","followers_url":"https://api.github.com/users/tgroh/followers","following_url":"https://api.github.com/users/tgroh/following{/other_user}","gists_url":"https://api.github.com/users/tgroh/gists{/gist_id}","starred_url":"https://api.github.com/users/tgroh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgroh/subscriptions","organizations_url":"https://api.github.com/users/tgroh/orgs","repos_url":"https://api.github.com/users/tgroh/repos","events_url":"https://api.github.com/users/tgroh/events{/privacy}","received_events_url":"https://api.github.com/users/tgroh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tgroh/beam","description":"Mirror of Apache Beam","fork":true,"url":"https://api.github.com/repos/tgroh/beam","forks_url":"https://api.github.com/repos/tgroh/beam/forks","keys_url":"https://api.github.com/repos/tgroh/beam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tgroh/beam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tgroh/beam/teams","hooks_url":"https://api.github.com/repos/tgroh/beam/hooks","issue_events_url":"https://api.github.com/repos/tgroh/beam/issues/events{/number}","events_url":"https://api.github.com/repos/tgroh/beam/events","assignees_url":"https://api.github.com/repos/tgroh/beam/assignees{/user}","branches_url":"https://api.github.com/repos/tgroh/beam/branches{/branch}","tags_url":"https://api.github.com/repos/tgroh/beam/tags","blobs_url":"https://api.github.com/repos/tgroh/beam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tgroh/beam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tgroh/beam/git/refs{/sha}","trees_url":"https://api.github.com/repos/tgroh/beam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tgroh/beam/statuses/{sha}","languages_url":"https://api.github.com/repos/tgroh/beam/languages","stargazers_url":"https://api.github.com/repos/tgroh/beam/stargazers","contributors_url":"https://api.github.com/repos/tgroh/beam/contributors","subscribers_url":"https://api.github.com/repos/tgroh/beam/subscribers","subscription_url":"https://api.github.com/repos/tgroh/beam/subscription","commits_url":"https://api.github.com/repos/tgroh/beam/commits{/sha}","git_commits_url":"https://api.github.com/repos/tgroh/beam/git/commits{/sha}","comments_url":"https://api.github.com/repos/tgroh/beam/comments{/number}","issue_comment_url":"https://api.github.com/repos/tgroh/beam/issues/comments{/number}","contents_url":"https://api.github.com/repos/tgroh/beam/contents/{+path}","compare_url":"https://api.github.com/repos/tgroh/beam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tgroh/beam/merges","archive_url":"https://api.github.com/repos/tgroh/beam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tgroh/beam/downloads","issues_url":"https://api.github.com/repos/tgroh/beam/issues{/number}","pulls_url":"https://api.github.com/repos/tgroh/beam/pulls{/number}","milestones_url":"https://api.github.com/repos/tgroh/beam/milestones{/number}","notifications_url":"https://api.github.com/repos/tgroh/beam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tgroh/beam/labels{/name}","releases_url":"https://api.github.com/repos/tgroh/beam/releases{/id}","deployments_url":"https://api.github.com/repos/tgroh/beam/deployments","created_at":"2016-02-27T01:43:32Z","updated_at":"2018-05-24T17:32:27Z","pushed_at":"2018-05-24T23:43:37Z","git_url":"git://github.com/tgroh/beam.git","ssh_url":"git@github.com:tgroh/beam.git","clone_url":"https://github.com/tgroh/beam.git","svn_url":"https://github.com/tgroh/beam","homepage":"","size":62515,"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":"master"}},"base":{"label":"apache:master","ref":"master","sha":"e0cf774ac150300d92c0c62b9c5e070eb210419f","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":50904245,"name":"beam","full_name":"apache/beam","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/beam","description":"Apache Beam","fork":false,"url":"https://api.github.com/repos/apache/beam","forks_url":"https://api.github.com/repos/apache/beam/forks","keys_url":"https://api.github.com/repos/apache/beam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/beam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/beam/teams","hooks_url":"https://api.github.com/repos/apache/beam/hooks","issue_events_url":"https://api.github.com/repos/apache/beam/issues/events{/number}","events_url":"https://api.github.com/repos/apache/beam/events","assignees_url":"https://api.github.com/repos/apache/beam/assignees{/user}","branches_url":"https://api.github.com/repos/apache/beam/branches{/branch}","tags_url":"https://api.github.com/repos/apache/beam/tags","blobs_url":"https://api.github.com/repos/apache/beam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/beam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/beam/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/beam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/beam/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/beam/languages","stargazers_url":"https://api.github.com/repos/apache/beam/stargazers","contributors_url":"https://api.github.com/repos/apache/beam/contributors","subscribers_url":"https://api.github.com/repos/apache/beam/subscribers","subscription_url":"https://api.github.com/repos/apache/beam/subscription","commits_url":"https://api.github.com/repos/apache/beam/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/beam/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/beam/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/beam/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/beam/contents/{+path}","compare_url":"https://api.github.com/repos/apache/beam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/beam/merges","archive_url":"https://api.github.com/repos/apache/beam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/beam/downloads","issues_url":"https://api.github.com/repos/apache/beam/issues{/number}","pulls_url":"https://api.github.com/repos/apache/beam/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/beam/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/beam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/beam/labels{/name}","releases_url":"https://api.github.com/repos/apache/beam/releases{/id}","deployments_url":"https://api.github.com/repos/apache/beam/deployments","created_at":"2016-02-02T08:00:06Z","updated_at":"2018-05-26T00:40:50Z","pushed_at":"2018-05-26T00:40:35Z","git_url":"git://github.com/apache/beam.git","ssh_url":"git@github.com:apache/beam.git","clone_url":"https://github.com/apache/beam.git","svn_url":"https://github.com/apache/beam","homepage":"","size":64123,"stargazers_count":1878,"watchers_count":1878,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1158,"mirror_url":null,"archived":false,"open_issues_count":108,"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":1158,"open_issues":108,"watchers":1878,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/beam/pulls/5456"},"html":{"href":"https://github.com/apache/beam/pull/5456"},"issue":{"href":"https://api.github.com/repos/apache/beam/issues/5456"},"comments":{"href":"https://api.github.com/repos/apache/beam/issues/5456/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/beam/pulls/5456/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/beam/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/beam/pulls/5456/commits"},"statuses":{"href":"https://api.github.com/repos/apache/beam/statuses/27c1c8690a4712c6722ba352139ec5e31e3f1240"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"tgroh"}}