{"action":"created","comment":{"url":"https://api.github.com/repos/linkedin/pinot/pulls/comments/82239740","pull_request_review_id":3161298,"id":82239740,"diff_hunk":"@@ -0,0 +1,119 @@\n+/**\n+ * Copyright (C) 2014-2016 LinkedIn Corp. (pinot-core@linkedin.com)\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * 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 com.linkedin.pinot.tools;\n+\n+import java.util.Map;\n+import java.util.Set;\n+import org.apache.helix.model.IdealState;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import com.google.common.base.Function;\n+import com.linkedin.pinot.common.config.AbstractTableConfig;\n+import com.linkedin.pinot.common.config.TableNameBuilder;\n+import com.linkedin.pinot.common.metadata.ZKMetadataProvider;\n+import com.linkedin.pinot.common.utils.helix.HelixHelper;\n+import com.linkedin.pinot.common.utils.retry.RetryPolicies;\n+import javax.annotation.Nullable;\n+\n+\n+public class PinotNumReplicaChanger extends PinotSegmentRebalancer {","path":"pinot-tools/src/main/java/com/linkedin/pinot/tools/PinotNumReplicaChanger.java","position":33,"original_position":33,"commit_id":"00a508f3975583c0323b9f04cc5e92f5adb14c25","original_commit_id":"00a508f3975583c0323b9f04cc5e92f5adb14c25","user":{"login":"kishoreg","id":850791,"avatar_url":"https://avatars.githubusercontent.com/u/850791?v=3","gravatar_id":"","url":"https://api.github.com/users/kishoreg","html_url":"https://github.com/kishoreg","followers_url":"https://api.github.com/users/kishoreg/followers","following_url":"https://api.github.com/users/kishoreg/following{/other_user}","gists_url":"https://api.github.com/users/kishoreg/gists{/gist_id}","starred_url":"https://api.github.com/users/kishoreg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kishoreg/subscriptions","organizations_url":"https://api.github.com/users/kishoreg/orgs","repos_url":"https://api.github.com/users/kishoreg/repos","events_url":"https://api.github.com/users/kishoreg/events{/privacy}","received_events_url":"https://api.github.com/users/kishoreg/received_events","type":"User","site_admin":false},"body":"I think i figured that it's re-using lot of methods from segmentrebalancer. This is fine for now but eventually, we need to extract them into separate class.","created_at":"2016-10-06T17:24:33Z","updated_at":"2016-10-06T17:24:34Z","html_url":"https://github.com/linkedin/pinot/pull/646#discussion_r82239740","pull_request_url":"https://api.github.com/repos/linkedin/pinot/pulls/646","_links":{"self":{"href":"https://api.github.com/repos/linkedin/pinot/pulls/comments/82239740"},"html":{"href":"https://github.com/linkedin/pinot/pull/646#discussion_r82239740"},"pull_request":{"href":"https://api.github.com/repos/linkedin/pinot/pulls/646"}}},"pull_request":{"url":"https://api.github.com/repos/linkedin/pinot/pulls/646","id":88160118,"html_url":"https://github.com/linkedin/pinot/pull/646","diff_url":"https://github.com/linkedin/pinot/pull/646.diff","patch_url":"https://github.com/linkedin/pinot/pull/646.patch","issue_url":"https://api.github.com/repos/linkedin/pinot/issues/646","number":646,"state":"open","locked":false,"title":"Added a utility to reduce number of replicas for an offline table","user":{"login":"mcvsubbu","id":2279037,"avatar_url":"https://avatars.githubusercontent.com/u/2279037?v=3","gravatar_id":"","url":"https://api.github.com/users/mcvsubbu","html_url":"https://github.com/mcvsubbu","followers_url":"https://api.github.com/users/mcvsubbu/followers","following_url":"https://api.github.com/users/mcvsubbu/following{/other_user}","gists_url":"https://api.github.com/users/mcvsubbu/gists{/gist_id}","starred_url":"https://api.github.com/users/mcvsubbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcvsubbu/subscriptions","organizations_url":"https://api.github.com/users/mcvsubbu/orgs","repos_url":"https://api.github.com/users/mcvsubbu/repos","events_url":"https://api.github.com/users/mcvsubbu/events{/privacy}","received_events_url":"https://api.github.com/users/mcvsubbu/received_events","type":"User","site_admin":false},"body":"If we want to reduce the number of replicas for an offline table, then\nrunning helix AutoRebalanceStragy to recompute partitions does not work.\nIt does work if we want to increase number of replicas.\n\nAdded a separate utility command to reduce the number of replicas.\n\nAlso fixed the Rebalancer to account for IdealState changes during the time\nth command is run.","created_at":"2016-10-05T21:24:41Z","updated_at":"2016-10-06T17:24:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38cdc8ef261157e0da97d647d973b3573f173bee","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/linkedin/pinot/pulls/646/commits","review_comments_url":"https://api.github.com/repos/linkedin/pinot/pulls/646/comments","review_comment_url":"https://api.github.com/repos/linkedin/pinot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linkedin/pinot/issues/646/comments","statuses_url":"https://api.github.com/repos/linkedin/pinot/statuses/00a508f3975583c0323b9f04cc5e92f5adb14c25","head":{"label":"linkedin:pinot-change-replicas","ref":"pinot-change-replicas","sha":"00a508f3975583c0323b9f04cc5e92f5adb14c25","user":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?v=3","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"repo":{"id":19961085,"name":"pinot","full_name":"linkedin/pinot","owner":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?v=3","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linkedin/pinot","description":"A realtime distributed OLAP datastore","fork":false,"url":"https://api.github.com/repos/linkedin/pinot","forks_url":"https://api.github.com/repos/linkedin/pinot/forks","keys_url":"https://api.github.com/repos/linkedin/pinot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linkedin/pinot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linkedin/pinot/teams","hooks_url":"https://api.github.com/repos/linkedin/pinot/hooks","issue_events_url":"https://api.github.com/repos/linkedin/pinot/issues/events{/number}","events_url":"https://api.github.com/repos/linkedin/pinot/events","assignees_url":"https://api.github.com/repos/linkedin/pinot/assignees{/user}","branches_url":"https://api.github.com/repos/linkedin/pinot/branches{/branch}","tags_url":"https://api.github.com/repos/linkedin/pinot/tags","blobs_url":"https://api.github.com/repos/linkedin/pinot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linkedin/pinot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linkedin/pinot/git/refs{/sha}","trees_url":"https://api.github.com/repos/linkedin/pinot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linkedin/pinot/statuses/{sha}","languages_url":"https://api.github.com/repos/linkedin/pinot/languages","stargazers_url":"https://api.github.com/repos/linkedin/pinot/stargazers","contributors_url":"https://api.github.com/repos/linkedin/pinot/contributors","subscribers_url":"https://api.github.com/repos/linkedin/pinot/subscribers","subscription_url":"https://api.github.com/repos/linkedin/pinot/subscription","commits_url":"https://api.github.com/repos/linkedin/pinot/commits{/sha}","git_commits_url":"https://api.github.com/repos/linkedin/pinot/git/commits{/sha}","comments_url":"https://api.github.com/repos/linkedin/pinot/comments{/number}","issue_comment_url":"https://api.github.com/repos/linkedin/pinot/issues/comments{/number}","contents_url":"https://api.github.com/repos/linkedin/pinot/contents/{+path}","compare_url":"https://api.github.com/repos/linkedin/pinot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linkedin/pinot/merges","archive_url":"https://api.github.com/repos/linkedin/pinot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linkedin/pinot/downloads","issues_url":"https://api.github.com/repos/linkedin/pinot/issues{/number}","pulls_url":"https://api.github.com/repos/linkedin/pinot/pulls{/number}","milestones_url":"https://api.github.com/repos/linkedin/pinot/milestones{/number}","notifications_url":"https://api.github.com/repos/linkedin/pinot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linkedin/pinot/labels{/name}","releases_url":"https://api.github.com/repos/linkedin/pinot/releases{/id}","deployments_url":"https://api.github.com/repos/linkedin/pinot/deployments","created_at":"2014-05-19T23:27:48Z","updated_at":"2016-09-29T02:23:44Z","pushed_at":"2016-10-06T17:07:32Z","git_url":"git://github.com/linkedin/pinot.git","ssh_url":"git@github.com:linkedin/pinot.git","clone_url":"https://github.com/linkedin/pinot.git","svn_url":"https://github.com/linkedin/pinot","homepage":"https://github.com/linkedin/pinot/wiki","size":145643,"stargazers_count":1350,"watchers_count":1350,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":225,"mirror_url":null,"open_issues_count":79,"forks":225,"open_issues":79,"watchers":1350,"default_branch":"master"}},"base":{"label":"linkedin:master","ref":"master","sha":"b72a70225b2c99c33cab38a5b400c3e9d615cdec","user":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?v=3","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"repo":{"id":19961085,"name":"pinot","full_name":"linkedin/pinot","owner":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?v=3","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linkedin/pinot","description":"A realtime distributed OLAP datastore","fork":false,"url":"https://api.github.com/repos/linkedin/pinot","forks_url":"https://api.github.com/repos/linkedin/pinot/forks","keys_url":"https://api.github.com/repos/linkedin/pinot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linkedin/pinot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linkedin/pinot/teams","hooks_url":"https://api.github.com/repos/linkedin/pinot/hooks","issue_events_url":"https://api.github.com/repos/linkedin/pinot/issues/events{/number}","events_url":"https://api.github.com/repos/linkedin/pinot/events","assignees_url":"https://api.github.com/repos/linkedin/pinot/assignees{/user}","branches_url":"https://api.github.com/repos/linkedin/pinot/branches{/branch}","tags_url":"https://api.github.com/repos/linkedin/pinot/tags","blobs_url":"https://api.github.com/repos/linkedin/pinot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linkedin/pinot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linkedin/pinot/git/refs{/sha}","trees_url":"https://api.github.com/repos/linkedin/pinot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linkedin/pinot/statuses/{sha}","languages_url":"https://api.github.com/repos/linkedin/pinot/languages","stargazers_url":"https://api.github.com/repos/linkedin/pinot/stargazers","contributors_url":"https://api.github.com/repos/linkedin/pinot/contributors","subscribers_url":"https://api.github.com/repos/linkedin/pinot/subscribers","subscription_url":"https://api.github.com/repos/linkedin/pinot/subscription","commits_url":"https://api.github.com/repos/linkedin/pinot/commits{/sha}","git_commits_url":"https://api.github.com/repos/linkedin/pinot/git/commits{/sha}","comments_url":"https://api.github.com/repos/linkedin/pinot/comments{/number}","issue_comment_url":"https://api.github.com/repos/linkedin/pinot/issues/comments{/number}","contents_url":"https://api.github.com/repos/linkedin/pinot/contents/{+path}","compare_url":"https://api.github.com/repos/linkedin/pinot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linkedin/pinot/merges","archive_url":"https://api.github.com/repos/linkedin/pinot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linkedin/pinot/downloads","issues_url":"https://api.github.com/repos/linkedin/pinot/issues{/number}","pulls_url":"https://api.github.com/repos/linkedin/pinot/pulls{/number}","milestones_url":"https://api.github.com/repos/linkedin/pinot/milestones{/number}","notifications_url":"https://api.github.com/repos/linkedin/pinot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linkedin/pinot/labels{/name}","releases_url":"https://api.github.com/repos/linkedin/pinot/releases{/id}","deployments_url":"https://api.github.com/repos/linkedin/pinot/deployments","created_at":"2014-05-19T23:27:48Z","updated_at":"2016-09-29T02:23:44Z","pushed_at":"2016-10-06T17:07:32Z","git_url":"git://github.com/linkedin/pinot.git","ssh_url":"git@github.com:linkedin/pinot.git","clone_url":"https://github.com/linkedin/pinot.git","svn_url":"https://github.com/linkedin/pinot","homepage":"https://github.com/linkedin/pinot/wiki","size":145643,"stargazers_count":1350,"watchers_count":1350,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":225,"mirror_url":null,"open_issues_count":79,"forks":225,"open_issues":79,"watchers":1350,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkedin/pinot/pulls/646"},"html":{"href":"https://github.com/linkedin/pinot/pull/646"},"issue":{"href":"https://api.github.com/repos/linkedin/pinot/issues/646"},"comments":{"href":"https://api.github.com/repos/linkedin/pinot/issues/646/comments"},"review_comments":{"href":"https://api.github.com/repos/linkedin/pinot/pulls/646/comments"},"review_comment":{"href":"https://api.github.com/repos/linkedin/pinot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linkedin/pinot/pulls/646/commits"},"statuses":{"href":"https://api.github.com/repos/linkedin/pinot/statuses/00a508f3975583c0323b9f04cc5e92f5adb14c25"}}}}
{"actor":{"display_login":"kishoreg"}}