{"action":"created","comment":{"url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/comments/61615068","id":61615068,"diff_hunk":"@@ -52,4 +52,6 @@ message QueryContext {\n \n   // NOTE(zuyu): For UpdateWorkOrder only.\n   repeated UpdateGroup update_groups = 9;\n+\n+  required uint64 query_id = 10;","path":"query_execution/QueryContext.proto","position":5,"original_position":5,"commit_id":"dd62b80efab2f97c96cc118c87754c2a640cba73","original_commit_id":"dd62b80efab2f97c96cc118c87754c2a640cba73","user":{"login":"zuyu","id":2245572,"avatar_url":"https://avatars.githubusercontent.com/u/2245572?v=3","gravatar_id":"","url":"https://api.github.com/users/zuyu","html_url":"https://github.com/zuyu","followers_url":"https://api.github.com/users/zuyu/followers","following_url":"https://api.github.com/users/zuyu/following{/other_user}","gists_url":"https://api.github.com/users/zuyu/gists{/gist_id}","starred_url":"https://api.github.com/users/zuyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zuyu/subscriptions","organizations_url":"https://api.github.com/users/zuyu/orgs","repos_url":"https://api.github.com/users/zuyu/repos","events_url":"https://api.github.com/users/zuyu/events{/privacy}","received_events_url":"https://api.github.com/users/zuyu/received_events","type":"User","site_admin":false},"body":"`query_id` will not change in future, but some fields may add or remove. So setting `query_id` to `1` reduce the chances to change the assigning numbers.","created_at":"2016-04-29T17:25:27Z","updated_at":"2016-04-29T17:25:27Z","html_url":"https://github.com/pivotalsoftware/quickstep/pull/190#discussion_r61615068","pull_request_url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/190","_links":{"self":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/comments/61615068"},"html":{"href":"https://github.com/pivotalsoftware/quickstep/pull/190#discussion_r61615068"},"pull_request":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/190"}}},"pull_request":{"url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/190","id":67784647,"html_url":"https://github.com/pivotalsoftware/quickstep/pull/190","diff_url":"https://github.com/pivotalsoftware/quickstep/pull/190.diff","patch_url":"https://github.com/pivotalsoftware/quickstep/pull/190.patch","issue_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/190","number":190,"state":"open","locked":false,"title":"Introducing PolicyEnforcer and long lived Foreman thread","user":{"login":"hbdeshmukh","id":3750801,"avatar_url":"https://avatars.githubusercontent.com/u/3750801?v=3","gravatar_id":"","url":"https://api.github.com/users/hbdeshmukh","html_url":"https://github.com/hbdeshmukh","followers_url":"https://api.github.com/users/hbdeshmukh/followers","following_url":"https://api.github.com/users/hbdeshmukh/following{/other_user}","gists_url":"https://api.github.com/users/hbdeshmukh/gists{/gist_id}","starred_url":"https://api.github.com/users/hbdeshmukh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbdeshmukh/subscriptions","organizations_url":"https://api.github.com/users/hbdeshmukh/orgs","repos_url":"https://api.github.com/users/hbdeshmukh/repos","events_url":"https://api.github.com/users/hbdeshmukh/events{/privacy}","received_events_url":"https://api.github.com/users/hbdeshmukh/received_events","type":"User","site_admin":false},"body":"This PR introduces basic skeleton of PolicyEnforcer and makes the Foreman thread understand concurrent queries, as well as allows the Foreman thread to live throughout the lifetime of the Quickstep process. Some key highlights are described below: \r\n\r\n- Creation of a sekeleton PolicyEnforcer class.\r\n\r\n- Foreman (C++ class) is now primarily responsible for dispatching work orders to workers and collect messages coming from worker threads during query execution. \r\n\r\n- PolicyEnforcer can talk to multiple QueryManager instances to collect WorkOrders to be dispatched. \r\n\r\n- PolicyEnforcer receives messages from Foreman, figures out the recipient of the message (using query ID in the message) and relays it to the appropriate QueryManager instance. \r\n\r\n- PolicyEnforcer can also perform admission control. \r\n\r\n- Foreman thread now doesn't die after receipt of a new query, unlike earlier. Instead it stays alive throughout the lifetime of Quickstep process. \r\n\r\n- The main thread is now capable of sending and receiving messages through TMB. \r\n\r\n- A new query sent via command line is sent from the main thread to the Foreman thread via a TMB message. \r\n\r\n- Moving some commonly used code in utility class. ","created_at":"2016-04-25T20:41:39Z","updated_at":"2016-04-29T17:25:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dfdad630bbebdcd423c0bda4a4cc9f3a02ddc199","assignee":{"login":"zuyu","id":2245572,"avatar_url":"https://avatars.githubusercontent.com/u/2245572?v=3","gravatar_id":"","url":"https://api.github.com/users/zuyu","html_url":"https://github.com/zuyu","followers_url":"https://api.github.com/users/zuyu/followers","following_url":"https://api.github.com/users/zuyu/following{/other_user}","gists_url":"https://api.github.com/users/zuyu/gists{/gist_id}","starred_url":"https://api.github.com/users/zuyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zuyu/subscriptions","organizations_url":"https://api.github.com/users/zuyu/orgs","repos_url":"https://api.github.com/users/zuyu/repos","events_url":"https://api.github.com/users/zuyu/events{/privacy}","received_events_url":"https://api.github.com/users/zuyu/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/190/commits","review_comments_url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/190/comments","review_comment_url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/190/comments","statuses_url":"https://api.github.com/repos/pivotalsoftware/quickstep/statuses/dd62b80efab2f97c96cc118c87754c2a640cba73","head":{"label":"pivotalsoftware:query-manager-used-in-foreman","ref":"query-manager-used-in-foreman","sha":"dd62b80efab2f97c96cc118c87754c2a640cba73","user":{"login":"pivotalsoftware","id":4247270,"avatar_url":"https://avatars.githubusercontent.com/u/4247270?v=3","gravatar_id":"","url":"https://api.github.com/users/pivotalsoftware","html_url":"https://github.com/pivotalsoftware","followers_url":"https://api.github.com/users/pivotalsoftware/followers","following_url":"https://api.github.com/users/pivotalsoftware/following{/other_user}","gists_url":"https://api.github.com/users/pivotalsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/pivotalsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pivotalsoftware/subscriptions","organizations_url":"https://api.github.com/users/pivotalsoftware/orgs","repos_url":"https://api.github.com/users/pivotalsoftware/repos","events_url":"https://api.github.com/users/pivotalsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/pivotalsoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":45578105,"name":"quickstep","full_name":"pivotalsoftware/quickstep","owner":{"login":"pivotalsoftware","id":4247270,"avatar_url":"https://avatars.githubusercontent.com/u/4247270?v=3","gravatar_id":"","url":"https://api.github.com/users/pivotalsoftware","html_url":"https://github.com/pivotalsoftware","followers_url":"https://api.github.com/users/pivotalsoftware/followers","following_url":"https://api.github.com/users/pivotalsoftware/following{/other_user}","gists_url":"https://api.github.com/users/pivotalsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/pivotalsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pivotalsoftware/subscriptions","organizations_url":"https://api.github.com/users/pivotalsoftware/orgs","repos_url":"https://api.github.com/users/pivotalsoftware/repos","events_url":"https://api.github.com/users/pivotalsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/pivotalsoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pivotalsoftware/quickstep","description":"Quickstep Project","fork":false,"url":"https://api.github.com/repos/pivotalsoftware/quickstep","forks_url":"https://api.github.com/repos/pivotalsoftware/quickstep/forks","keys_url":"https://api.github.com/repos/pivotalsoftware/quickstep/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pivotalsoftware/quickstep/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pivotalsoftware/quickstep/teams","hooks_url":"https://api.github.com/repos/pivotalsoftware/quickstep/hooks","issue_events_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/events{/number}","events_url":"https://api.github.com/repos/pivotalsoftware/quickstep/events","assignees_url":"https://api.github.com/repos/pivotalsoftware/quickstep/assignees{/user}","branches_url":"https://api.github.com/repos/pivotalsoftware/quickstep/branches{/branch}","tags_url":"https://api.github.com/repos/pivotalsoftware/quickstep/tags","blobs_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/refs{/sha}","trees_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pivotalsoftware/quickstep/statuses/{sha}","languages_url":"https://api.github.com/repos/pivotalsoftware/quickstep/languages","stargazers_url":"https://api.github.com/repos/pivotalsoftware/quickstep/stargazers","contributors_url":"https://api.github.com/repos/pivotalsoftware/quickstep/contributors","subscribers_url":"https://api.github.com/repos/pivotalsoftware/quickstep/subscribers","subscription_url":"https://api.github.com/repos/pivotalsoftware/quickstep/subscription","commits_url":"https://api.github.com/repos/pivotalsoftware/quickstep/commits{/sha}","git_commits_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/commits{/sha}","comments_url":"https://api.github.com/repos/pivotalsoftware/quickstep/comments{/number}","issue_comment_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/comments{/number}","contents_url":"https://api.github.com/repos/pivotalsoftware/quickstep/contents/{+path}","compare_url":"https://api.github.com/repos/pivotalsoftware/quickstep/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pivotalsoftware/quickstep/merges","archive_url":"https://api.github.com/repos/pivotalsoftware/quickstep/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pivotalsoftware/quickstep/downloads","issues_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues{/number}","pulls_url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls{/number}","milestones_url":"https://api.github.com/repos/pivotalsoftware/quickstep/milestones{/number}","notifications_url":"https://api.github.com/repos/pivotalsoftware/quickstep/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pivotalsoftware/quickstep/labels{/name}","releases_url":"https://api.github.com/repos/pivotalsoftware/quickstep/releases{/id}","deployments_url":"https://api.github.com/repos/pivotalsoftware/quickstep/deployments","created_at":"2015-11-05T01:06:50Z","updated_at":"2016-04-26T18:43:31Z","pushed_at":"2016-04-29T05:27:31Z","git_url":"git://github.com/pivotalsoftware/quickstep.git","ssh_url":"git@github.com:pivotalsoftware/quickstep.git","clone_url":"https://github.com/pivotalsoftware/quickstep.git","svn_url":"https://github.com/pivotalsoftware/quickstep","homepage":null,"size":9041,"stargazers_count":16,"watchers_count":16,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":22,"forks":10,"open_issues":22,"watchers":16,"default_branch":"master"}},"base":{"label":"pivotalsoftware:master","ref":"master","sha":"3f72ac02c2a55da47f003074c352a159083222fc","user":{"login":"pivotalsoftware","id":4247270,"avatar_url":"https://avatars.githubusercontent.com/u/4247270?v=3","gravatar_id":"","url":"https://api.github.com/users/pivotalsoftware","html_url":"https://github.com/pivotalsoftware","followers_url":"https://api.github.com/users/pivotalsoftware/followers","following_url":"https://api.github.com/users/pivotalsoftware/following{/other_user}","gists_url":"https://api.github.com/users/pivotalsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/pivotalsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pivotalsoftware/subscriptions","organizations_url":"https://api.github.com/users/pivotalsoftware/orgs","repos_url":"https://api.github.com/users/pivotalsoftware/repos","events_url":"https://api.github.com/users/pivotalsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/pivotalsoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":45578105,"name":"quickstep","full_name":"pivotalsoftware/quickstep","owner":{"login":"pivotalsoftware","id":4247270,"avatar_url":"https://avatars.githubusercontent.com/u/4247270?v=3","gravatar_id":"","url":"https://api.github.com/users/pivotalsoftware","html_url":"https://github.com/pivotalsoftware","followers_url":"https://api.github.com/users/pivotalsoftware/followers","following_url":"https://api.github.com/users/pivotalsoftware/following{/other_user}","gists_url":"https://api.github.com/users/pivotalsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/pivotalsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pivotalsoftware/subscriptions","organizations_url":"https://api.github.com/users/pivotalsoftware/orgs","repos_url":"https://api.github.com/users/pivotalsoftware/repos","events_url":"https://api.github.com/users/pivotalsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/pivotalsoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pivotalsoftware/quickstep","description":"Quickstep Project","fork":false,"url":"https://api.github.com/repos/pivotalsoftware/quickstep","forks_url":"https://api.github.com/repos/pivotalsoftware/quickstep/forks","keys_url":"https://api.github.com/repos/pivotalsoftware/quickstep/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pivotalsoftware/quickstep/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pivotalsoftware/quickstep/teams","hooks_url":"https://api.github.com/repos/pivotalsoftware/quickstep/hooks","issue_events_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/events{/number}","events_url":"https://api.github.com/repos/pivotalsoftware/quickstep/events","assignees_url":"https://api.github.com/repos/pivotalsoftware/quickstep/assignees{/user}","branches_url":"https://api.github.com/repos/pivotalsoftware/quickstep/branches{/branch}","tags_url":"https://api.github.com/repos/pivotalsoftware/quickstep/tags","blobs_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/refs{/sha}","trees_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pivotalsoftware/quickstep/statuses/{sha}","languages_url":"https://api.github.com/repos/pivotalsoftware/quickstep/languages","stargazers_url":"https://api.github.com/repos/pivotalsoftware/quickstep/stargazers","contributors_url":"https://api.github.com/repos/pivotalsoftware/quickstep/contributors","subscribers_url":"https://api.github.com/repos/pivotalsoftware/quickstep/subscribers","subscription_url":"https://api.github.com/repos/pivotalsoftware/quickstep/subscription","commits_url":"https://api.github.com/repos/pivotalsoftware/quickstep/commits{/sha}","git_commits_url":"https://api.github.com/repos/pivotalsoftware/quickstep/git/commits{/sha}","comments_url":"https://api.github.com/repos/pivotalsoftware/quickstep/comments{/number}","issue_comment_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/comments{/number}","contents_url":"https://api.github.com/repos/pivotalsoftware/quickstep/contents/{+path}","compare_url":"https://api.github.com/repos/pivotalsoftware/quickstep/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pivotalsoftware/quickstep/merges","archive_url":"https://api.github.com/repos/pivotalsoftware/quickstep/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pivotalsoftware/quickstep/downloads","issues_url":"https://api.github.com/repos/pivotalsoftware/quickstep/issues{/number}","pulls_url":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls{/number}","milestones_url":"https://api.github.com/repos/pivotalsoftware/quickstep/milestones{/number}","notifications_url":"https://api.github.com/repos/pivotalsoftware/quickstep/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pivotalsoftware/quickstep/labels{/name}","releases_url":"https://api.github.com/repos/pivotalsoftware/quickstep/releases{/id}","deployments_url":"https://api.github.com/repos/pivotalsoftware/quickstep/deployments","created_at":"2015-11-05T01:06:50Z","updated_at":"2016-04-26T18:43:31Z","pushed_at":"2016-04-29T05:27:31Z","git_url":"git://github.com/pivotalsoftware/quickstep.git","ssh_url":"git@github.com:pivotalsoftware/quickstep.git","clone_url":"https://github.com/pivotalsoftware/quickstep.git","svn_url":"https://github.com/pivotalsoftware/quickstep","homepage":null,"size":9041,"stargazers_count":16,"watchers_count":16,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":22,"forks":10,"open_issues":22,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/190"},"html":{"href":"https://github.com/pivotalsoftware/quickstep/pull/190"},"issue":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/190"},"comments":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/issues/190/comments"},"review_comments":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/190/comments"},"review_comment":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/pulls/190/commits"},"statuses":{"href":"https://api.github.com/repos/pivotalsoftware/quickstep/statuses/dd62b80efab2f97c96cc118c87754c2a640cba73"}}}}