{"action":"created","comment":{"url":"https://api.github.com/repos/airbnb/kafkat/pulls/comments/32598301","id":32598301,"diff_hunk":"@@ -37,9 +38,17 @@ def run\n         broker_count = broker_ids.size\n \n         topics.each do |_, t|\n+          if opts[:partitions]","path":"lib/kafkat/command/reassign.rb","position":21,"original_position":21,"commit_id":"026f11d8deb66268f280a275cfd49a672ffd53f6","original_commit_id":"dc27737e4ef2c46666c5b41a1a87446160704648","user":{"login":"choang","id":602917,"avatar_url":"https://avatars.githubusercontent.com/u/602917?v=3","gravatar_id":"","url":"https://api.github.com/users/choang","html_url":"https://github.com/choang","followers_url":"https://api.github.com/users/choang/followers","following_url":"https://api.github.com/users/choang/following{/other_user}","gists_url":"https://api.github.com/users/choang/gists{/gist_id}","starred_url":"https://api.github.com/users/choang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/choang/subscriptions","organizations_url":"https://api.github.com/users/choang/orgs","repos_url":"https://api.github.com/users/choang/repos","events_url":"https://api.github.com/users/choang/events{/privacy}","received_events_url":"https://api.github.com/users/choang/received_events","type":"User","site_admin":false},"body":"done","created_at":"2015-06-17T06:28:50Z","updated_at":"2015-06-17T06:28:50Z","html_url":"https://github.com/airbnb/kafkat/pull/3#discussion_r32598301","pull_request_url":"https://api.github.com/repos/airbnb/kafkat/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/airbnb/kafkat/pulls/comments/32598301"},"html":{"href":"https://github.com/airbnb/kafkat/pull/3#discussion_r32598301"},"pull_request":{"href":"https://api.github.com/repos/airbnb/kafkat/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/airbnb/kafkat/pulls/3","id":29960168,"html_url":"https://github.com/airbnb/kafkat/pull/3","diff_url":"https://github.com/airbnb/kafkat/pull/3.diff","patch_url":"https://github.com/airbnb/kafkat/pull/3.patch","issue_url":"https://api.github.com/repos/airbnb/kafkat/issues/3","number":3,"state":"open","locked":false,"title":"Added support for specifying partitions targeted for reassignment","user":{"login":"choang","id":602917,"avatar_url":"https://avatars.githubusercontent.com/u/602917?v=3","gravatar_id":"","url":"https://api.github.com/users/choang","html_url":"https://github.com/choang","followers_url":"https://api.github.com/users/choang/followers","following_url":"https://api.github.com/users/choang/following{/other_user}","gists_url":"https://api.github.com/users/choang/gists{/gist_id}","starred_url":"https://api.github.com/users/choang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/choang/subscriptions","organizations_url":"https://api.github.com/users/choang/orgs","repos_url":"https://api.github.com/users/choang/repos","events_url":"https://api.github.com/users/choang/events{/privacy}","received_events_url":"https://api.github.com/users/choang/received_events","type":"User","site_admin":false},"body":"Most of the time, we see that only specific partitions need reassignment, so when we used the existing reassign command for a topic, we found that we incurred unnecessary workload for Kafka to replicate all partitions for a topic.  With this change, we can trigger only targeted partitions to get reassigned by using the following command:\r\n```\r\nkafkat reassign my_topic -p 1 2 3\r\n```\r\nThe above command will only cause reassignment for partitions 1, 2, and 3 for the topic <tt>my_topic</tt>.\r\n\r\nOne caveat is that this option may not be as effective if used with all topics, but I couldn't think of a simple way to achieve this through the cli.","created_at":"2015-02-25T04:19:24Z","updated_at":"2015-06-17T06:28:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c8da69f6d4316511875a363d05b6713970640b0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/airbnb/kafkat/pulls/3/commits","review_comments_url":"https://api.github.com/repos/airbnb/kafkat/pulls/3/comments","review_comment_url":"https://api.github.com/repos/airbnb/kafkat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/airbnb/kafkat/issues/3/comments","statuses_url":"https://api.github.com/repos/airbnb/kafkat/statuses/026f11d8deb66268f280a275cfd49a672ffd53f6","head":{"label":"choang:reassign-partitions","ref":"reassign-partitions","sha":"026f11d8deb66268f280a275cfd49a672ffd53f6","user":{"login":"choang","id":602917,"avatar_url":"https://avatars.githubusercontent.com/u/602917?v=3","gravatar_id":"","url":"https://api.github.com/users/choang","html_url":"https://github.com/choang","followers_url":"https://api.github.com/users/choang/followers","following_url":"https://api.github.com/users/choang/following{/other_user}","gists_url":"https://api.github.com/users/choang/gists{/gist_id}","starred_url":"https://api.github.com/users/choang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/choang/subscriptions","organizations_url":"https://api.github.com/users/choang/orgs","repos_url":"https://api.github.com/users/choang/repos","events_url":"https://api.github.com/users/choang/events{/privacy}","received_events_url":"https://api.github.com/users/choang/received_events","type":"User","site_admin":false},"repo":{"id":31296556,"name":"kafkat","full_name":"choang/kafkat","owner":{"login":"choang","id":602917,"avatar_url":"https://avatars.githubusercontent.com/u/602917?v=3","gravatar_id":"","url":"https://api.github.com/users/choang","html_url":"https://github.com/choang","followers_url":"https://api.github.com/users/choang/followers","following_url":"https://api.github.com/users/choang/following{/other_user}","gists_url":"https://api.github.com/users/choang/gists{/gist_id}","starred_url":"https://api.github.com/users/choang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/choang/subscriptions","organizations_url":"https://api.github.com/users/choang/orgs","repos_url":"https://api.github.com/users/choang/repos","events_url":"https://api.github.com/users/choang/events{/privacy}","received_events_url":"https://api.github.com/users/choang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/choang/kafkat","description":"KafkaT-ool","fork":true,"url":"https://api.github.com/repos/choang/kafkat","forks_url":"https://api.github.com/repos/choang/kafkat/forks","keys_url":"https://api.github.com/repos/choang/kafkat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/choang/kafkat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/choang/kafkat/teams","hooks_url":"https://api.github.com/repos/choang/kafkat/hooks","issue_events_url":"https://api.github.com/repos/choang/kafkat/issues/events{/number}","events_url":"https://api.github.com/repos/choang/kafkat/events","assignees_url":"https://api.github.com/repos/choang/kafkat/assignees{/user}","branches_url":"https://api.github.com/repos/choang/kafkat/branches{/branch}","tags_url":"https://api.github.com/repos/choang/kafkat/tags","blobs_url":"https://api.github.com/repos/choang/kafkat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/choang/kafkat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/choang/kafkat/git/refs{/sha}","trees_url":"https://api.github.com/repos/choang/kafkat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/choang/kafkat/statuses/{sha}","languages_url":"https://api.github.com/repos/choang/kafkat/languages","stargazers_url":"https://api.github.com/repos/choang/kafkat/stargazers","contributors_url":"https://api.github.com/repos/choang/kafkat/contributors","subscribers_url":"https://api.github.com/repos/choang/kafkat/subscribers","subscription_url":"https://api.github.com/repos/choang/kafkat/subscription","commits_url":"https://api.github.com/repos/choang/kafkat/commits{/sha}","git_commits_url":"https://api.github.com/repos/choang/kafkat/git/commits{/sha}","comments_url":"https://api.github.com/repos/choang/kafkat/comments{/number}","issue_comment_url":"https://api.github.com/repos/choang/kafkat/issues/comments{/number}","contents_url":"https://api.github.com/repos/choang/kafkat/contents/{+path}","compare_url":"https://api.github.com/repos/choang/kafkat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/choang/kafkat/merges","archive_url":"https://api.github.com/repos/choang/kafkat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/choang/kafkat/downloads","issues_url":"https://api.github.com/repos/choang/kafkat/issues{/number}","pulls_url":"https://api.github.com/repos/choang/kafkat/pulls{/number}","milestones_url":"https://api.github.com/repos/choang/kafkat/milestones{/number}","notifications_url":"https://api.github.com/repos/choang/kafkat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/choang/kafkat/labels{/name}","releases_url":"https://api.github.com/repos/choang/kafkat/releases{/id}","created_at":"2015-02-25T04:10:23Z","updated_at":"2015-02-25T04:10:23Z","pushed_at":"2015-06-17T06:27:36Z","git_url":"git://github.com/choang/kafkat.git","ssh_url":"git@github.com:choang/kafkat.git","clone_url":"https://github.com/choang/kafkat.git","svn_url":"https://github.com/choang/kafkat","homepage":null,"size":122,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"master"}},"base":{"label":"airbnb:master","ref":"master","sha":"a667bb27a3ddc46ec7ab2af826268ccbd224ecc6","user":{"login":"airbnb","id":698437,"avatar_url":"https://avatars.githubusercontent.com/u/698437?v=3","gravatar_id":"","url":"https://api.github.com/users/airbnb","html_url":"https://github.com/airbnb","followers_url":"https://api.github.com/users/airbnb/followers","following_url":"https://api.github.com/users/airbnb/following{/other_user}","gists_url":"https://api.github.com/users/airbnb/gists{/gist_id}","starred_url":"https://api.github.com/users/airbnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airbnb/subscriptions","organizations_url":"https://api.github.com/users/airbnb/orgs","repos_url":"https://api.github.com/users/airbnb/repos","events_url":"https://api.github.com/users/airbnb/events{/privacy}","received_events_url":"https://api.github.com/users/airbnb/received_events","type":"Organization","site_admin":false},"repo":{"id":22970217,"name":"kafkat","full_name":"airbnb/kafkat","owner":{"login":"airbnb","id":698437,"avatar_url":"https://avatars.githubusercontent.com/u/698437?v=3","gravatar_id":"","url":"https://api.github.com/users/airbnb","html_url":"https://github.com/airbnb","followers_url":"https://api.github.com/users/airbnb/followers","following_url":"https://api.github.com/users/airbnb/following{/other_user}","gists_url":"https://api.github.com/users/airbnb/gists{/gist_id}","starred_url":"https://api.github.com/users/airbnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airbnb/subscriptions","organizations_url":"https://api.github.com/users/airbnb/orgs","repos_url":"https://api.github.com/users/airbnb/repos","events_url":"https://api.github.com/users/airbnb/events{/privacy}","received_events_url":"https://api.github.com/users/airbnb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/airbnb/kafkat","description":"KafkaT-ool","fork":false,"url":"https://api.github.com/repos/airbnb/kafkat","forks_url":"https://api.github.com/repos/airbnb/kafkat/forks","keys_url":"https://api.github.com/repos/airbnb/kafkat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/airbnb/kafkat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/airbnb/kafkat/teams","hooks_url":"https://api.github.com/repos/airbnb/kafkat/hooks","issue_events_url":"https://api.github.com/repos/airbnb/kafkat/issues/events{/number}","events_url":"https://api.github.com/repos/airbnb/kafkat/events","assignees_url":"https://api.github.com/repos/airbnb/kafkat/assignees{/user}","branches_url":"https://api.github.com/repos/airbnb/kafkat/branches{/branch}","tags_url":"https://api.github.com/repos/airbnb/kafkat/tags","blobs_url":"https://api.github.com/repos/airbnb/kafkat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/airbnb/kafkat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/airbnb/kafkat/git/refs{/sha}","trees_url":"https://api.github.com/repos/airbnb/kafkat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/airbnb/kafkat/statuses/{sha}","languages_url":"https://api.github.com/repos/airbnb/kafkat/languages","stargazers_url":"https://api.github.com/repos/airbnb/kafkat/stargazers","contributors_url":"https://api.github.com/repos/airbnb/kafkat/contributors","subscribers_url":"https://api.github.com/repos/airbnb/kafkat/subscribers","subscription_url":"https://api.github.com/repos/airbnb/kafkat/subscription","commits_url":"https://api.github.com/repos/airbnb/kafkat/commits{/sha}","git_commits_url":"https://api.github.com/repos/airbnb/kafkat/git/commits{/sha}","comments_url":"https://api.github.com/repos/airbnb/kafkat/comments{/number}","issue_comment_url":"https://api.github.com/repos/airbnb/kafkat/issues/comments{/number}","contents_url":"https://api.github.com/repos/airbnb/kafkat/contents/{+path}","compare_url":"https://api.github.com/repos/airbnb/kafkat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/airbnb/kafkat/merges","archive_url":"https://api.github.com/repos/airbnb/kafkat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/airbnb/kafkat/downloads","issues_url":"https://api.github.com/repos/airbnb/kafkat/issues{/number}","pulls_url":"https://api.github.com/repos/airbnb/kafkat/pulls{/number}","milestones_url":"https://api.github.com/repos/airbnb/kafkat/milestones{/number}","notifications_url":"https://api.github.com/repos/airbnb/kafkat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/airbnb/kafkat/labels{/name}","releases_url":"https://api.github.com/repos/airbnb/kafkat/releases{/id}","created_at":"2014-08-14T22:09:39Z","updated_at":"2015-06-12T19:09:00Z","pushed_at":"2015-06-17T06:27:37Z","git_url":"git://github.com/airbnb/kafkat.git","ssh_url":"git@github.com:airbnb/kafkat.git","clone_url":"https://github.com/airbnb/kafkat.git","svn_url":"https://github.com/airbnb/kafkat","homepage":null,"size":223,"stargazers_count":42,"watchers_count":42,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":2,"forks":7,"open_issues":2,"watchers":42,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/airbnb/kafkat/pulls/3"},"html":{"href":"https://github.com/airbnb/kafkat/pull/3"},"issue":{"href":"https://api.github.com/repos/airbnb/kafkat/issues/3"},"comments":{"href":"https://api.github.com/repos/airbnb/kafkat/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/airbnb/kafkat/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/airbnb/kafkat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/airbnb/kafkat/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/airbnb/kafkat/statuses/026f11d8deb66268f280a275cfd49a672ffd53f6"}}}}