{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-pinot/pulls/comments/304684440","pull_request_review_id":263368761,"id":304684440,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMwNDY4NDQ0MA==","diff_hunk":"@@ -133,6 +134,7 @@ private static long getRandomInitialDelayInSeconds() {\n   // If it's set to false, existing HLC realtime tables will stop consumption, and creation of new HLC tables will be disallowed.\n   // Please make sure there is no HLC table running in the cluster before disallowing it.\n   private static final String ALLOW_HLC_TABLES = \"controller.allow.hlc.tables\";\n+  private static final String HELIX_INSTANCE_TYPE = \"controller.helix.instance.type\";","path":"pinot-controller/src/main/java/org/apache/pinot/controller/ControllerConf.java","position":null,"original_position":12,"commit_id":"2857d25798ce0afdcd71dc83a4e2fbbbcd16cf74","original_commit_id":"e06a908142ae3aaefb007a55ed1491a70a4e4b4f","user":{"login":"jackjlli","id":35080149,"node_id":"MDQ6VXNlcjM1MDgwMTQ5","avatar_url":"https://avatars1.githubusercontent.com/u/35080149?v=4","gravatar_id":"","url":"https://api.github.com/users/jackjlli","html_url":"https://github.com/jackjlli","followers_url":"https://api.github.com/users/jackjlli/followers","following_url":"https://api.github.com/users/jackjlli/following{/other_user}","gists_url":"https://api.github.com/users/jackjlli/gists{/gist_id}","starred_url":"https://api.github.com/users/jackjlli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackjlli/subscriptions","organizations_url":"https://api.github.com/users/jackjlli/orgs","repos_url":"https://api.github.com/users/jackjlli/repos","events_url":"https://api.github.com/users/jackjlli/events{/privacy}","received_events_url":"https://api.github.com/users/jackjlli/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2019-07-17T23:37:24Z","updated_at":"2019-07-17T23:37:24Z","html_url":"https://github.com/apache/incubator-pinot/pull/4323#discussion_r304684440","pull_request_url":"https://api.github.com/repos/apache/incubator-pinot/pulls/4323","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-pinot/pulls/comments/304684440"},"html":{"href":"https://github.com/apache/incubator-pinot/pull/4323#discussion_r304684440"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-pinot/pulls/4323"}},"in_reply_to_id":304150564},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-pinot/pulls/4323","id":288523271,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjg4NTIzMjcx","html_url":"https://github.com/apache/incubator-pinot/pull/4323","diff_url":"https://github.com/apache/incubator-pinot/pull/4323.diff","patch_url":"https://github.com/apache/incubator-pinot/pull/4323.patch","issue_url":"https://api.github.com/repos/apache/incubator-pinot/issues/4323","number":4323,"state":"open","locked":false,"title":"[Controller Separation] Add logic for lead controller resource","user":{"login":"jackjlli","id":35080149,"node_id":"MDQ6VXNlcjM1MDgwMTQ5","avatar_url":"https://avatars1.githubusercontent.com/u/35080149?v=4","gravatar_id":"","url":"https://api.github.com/users/jackjlli","html_url":"https://github.com/jackjlli","followers_url":"https://api.github.com/users/jackjlli/followers","following_url":"https://api.github.com/users/jackjlli/following{/other_user}","gists_url":"https://api.github.com/users/jackjlli/gists{/gist_id}","starred_url":"https://api.github.com/users/jackjlli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackjlli/subscriptions","organizations_url":"https://api.github.com/users/jackjlli/orgs","repos_url":"https://api.github.com/users/jackjlli/repos","events_url":"https://api.github.com/users/jackjlli/events{/privacy}","received_events_url":"https://api.github.com/users/jackjlli/received_events","type":"User","site_admin":false},"body":"This is the last PR of controller separation ([Design doc](https://cwiki.apache.org/confluence/display/PINOT/Controller+Separation+between+Helix+and+Pinot)).\r\n\r\nThis PR:\r\n\r\n-  adds all the logic needed for lead controller resource. ControllerLeadershipManager is removed in this PR. All the periodic tasks are run depending on whether the current controller is the leader for given tables.\r\n\r\n- adds a API to get the controller leader id and partition index given a table name.\r\n\r\nAPI:\r\n```GET http://localhost:18998/tables/mytable/controller```\r\nResponse:\r\n```\r\n{\r\n  \"status\": \"Partition index: 10, lead controller: Controller_localhost_18998\"\r\n}\r\n```\r\n\r\nTesting different partition functions:\r\nIn order to make all the tables more evenly distribute to all 24 partitions, we benchmarked the partition functions against 2300+ tables. The result \"Diff\" is calculated by  (max number of tables in partitions - min number of tables in partitions). Here are the details:\r\n* Math.floorMod(rawTableName.hashCode(), 24)\r\nDiff : 45\r\n* Murmur2(rawTableName, 24)\r\nDiff : 28\r\n* (rawTableName.hashCode() & Integer.MAX_VALUE) % 24\r\nDiff : 33\r\n* Math.abs(rawTableName.hashCode()) % 24\r\nDiff : 56\r\n\r\nThe result shows `Murmur2` and `(rawTableName.hashCode() & Integer.MAX_VALUE) % 24` performs better distribution on the tables.\r\n\r\n\r\n\r\n\r\n","created_at":"2019-06-15T01:48:33Z","updated_at":"2019-07-17T23:37:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c8dce228b74489897e6c16efdce357399951571","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-pinot/pulls/4323/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-pinot/pulls/4323/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-pinot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-pinot/issues/4323/comments","statuses_url":"https://api.github.com/repos/apache/incubator-pinot/statuses/2857d25798ce0afdcd71dc83a4e2fbbbcd16cf74","head":{"label":"apache:add-logic-for-lead-controller-resource","ref":"add-logic-for-lead-controller-resource","sha":"2857d25798ce0afdcd71dc83a4e2fbbbcd16cf74","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","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":19961085,"node_id":"MDEwOlJlcG9zaXRvcnkxOTk2MTA4NQ==","name":"incubator-pinot","full_name":"apache/incubator-pinot","private":false,"owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","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},"html_url":"https://github.com/apache/incubator-pinot","description":"Apache Pinot (Incubating) - A realtime distributed OLAP datastore","fork":false,"url":"https://api.github.com/repos/apache/incubator-pinot","forks_url":"https://api.github.com/repos/apache/incubator-pinot/forks","keys_url":"https://api.github.com/repos/apache/incubator-pinot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-pinot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-pinot/teams","hooks_url":"https://api.github.com/repos/apache/incubator-pinot/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-pinot/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-pinot/events","assignees_url":"https://api.github.com/repos/apache/incubator-pinot/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-pinot/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-pinot/tags","blobs_url":"https://api.github.com/repos/apache/incubator-pinot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-pinot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-pinot/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-pinot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-pinot/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-pinot/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-pinot/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-pinot/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-pinot/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-pinot/subscription","commits_url":"https://api.github.com/repos/apache/incubator-pinot/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-pinot/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-pinot/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-pinot/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-pinot/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-pinot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-pinot/merges","archive_url":"https://api.github.com/repos/apache/incubator-pinot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-pinot/downloads","issues_url":"https://api.github.com/repos/apache/incubator-pinot/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-pinot/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-pinot/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-pinot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-pinot/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-pinot/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-pinot/deployments","created_at":"2014-05-19T23:27:48Z","updated_at":"2019-07-17T23:28:38Z","pushed_at":"2019-07-17T23:35:08Z","git_url":"git://github.com/apache/incubator-pinot.git","ssh_url":"git@github.com:apache/incubator-pinot.git","clone_url":"https://github.com/apache/incubator-pinot.git","svn_url":"https://github.com/apache/incubator-pinot","homepage":"https://pinot.apache.org","size":173025,"stargazers_count":2318,"watchers_count":2318,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":428,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":295,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":428,"open_issues":295,"watchers":2318,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"d2b298194259f814ab7e7b9e3a308e3ac29faad1","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","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":19961085,"node_id":"MDEwOlJlcG9zaXRvcnkxOTk2MTA4NQ==","name":"incubator-pinot","full_name":"apache/incubator-pinot","private":false,"owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","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},"html_url":"https://github.com/apache/incubator-pinot","description":"Apache Pinot (Incubating) - A realtime distributed OLAP datastore","fork":false,"url":"https://api.github.com/repos/apache/incubator-pinot","forks_url":"https://api.github.com/repos/apache/incubator-pinot/forks","keys_url":"https://api.github.com/repos/apache/incubator-pinot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-pinot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-pinot/teams","hooks_url":"https://api.github.com/repos/apache/incubator-pinot/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-pinot/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-pinot/events","assignees_url":"https://api.github.com/repos/apache/incubator-pinot/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-pinot/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-pinot/tags","blobs_url":"https://api.github.com/repos/apache/incubator-pinot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-pinot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-pinot/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-pinot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-pinot/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-pinot/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-pinot/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-pinot/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-pinot/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-pinot/subscription","commits_url":"https://api.github.com/repos/apache/incubator-pinot/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-pinot/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-pinot/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-pinot/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-pinot/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-pinot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-pinot/merges","archive_url":"https://api.github.com/repos/apache/incubator-pinot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-pinot/downloads","issues_url":"https://api.github.com/repos/apache/incubator-pinot/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-pinot/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-pinot/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-pinot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-pinot/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-pinot/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-pinot/deployments","created_at":"2014-05-19T23:27:48Z","updated_at":"2019-07-17T23:28:38Z","pushed_at":"2019-07-17T23:35:08Z","git_url":"git://github.com/apache/incubator-pinot.git","ssh_url":"git@github.com:apache/incubator-pinot.git","clone_url":"https://github.com/apache/incubator-pinot.git","svn_url":"https://github.com/apache/incubator-pinot","homepage":"https://pinot.apache.org","size":173025,"stargazers_count":2318,"watchers_count":2318,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":428,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":295,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":428,"open_issues":295,"watchers":2318,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-pinot/pulls/4323"},"html":{"href":"https://github.com/apache/incubator-pinot/pull/4323"},"issue":{"href":"https://api.github.com/repos/apache/incubator-pinot/issues/4323"},"comments":{"href":"https://api.github.com/repos/apache/incubator-pinot/issues/4323/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-pinot/pulls/4323/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-pinot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-pinot/pulls/4323/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-pinot/statuses/2857d25798ce0afdcd71dc83a4e2fbbbcd16cf74"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jackjlli"}}