{"action":"created","comment":{"url":"https://api.github.com/repos/basho/riak_cs/pulls/comments/28572891","id":28572891,"diff_hunk":"@@ -0,0 +1,199 @@\n+%% #!/usr/bin/env escript\n+\n+%% ---------------------------------------------------------------------\n+%%\n+%% Copyright (c) 2015 Basho Technologies, Inc.  All Rights Reserved.\n+%%\n+%% This file is provided to you under the Apache License,\n+%% Version 2.0 (the \"License\"); you may not use this file\n+%% except in compliance with the License.  You may obtain\n+%% 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,\n+%% software distributed under the License is distributed on an\n+%% \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+%% KIND, either express or implied.  See the License for the\n+%% specific language governing permissions and limitations\n+%% under the License.\n+%%\n+%% ---------------------------------------------------------------------\n+\n+-module(select_gc_bucket).\n+\n+-compile(export_all).\n+\n+-include_lib(\"riak_cs/include/riak_cs.hrl\").\n+\n+-record(state,\n+        {logger :: pid(),\n+         ring_size = 64 :: non_neg_integer(),\n+         threshold :: non_neg_integer() | undefined,\n+         keycount = 0 :: non_neg_integer(),\n+         manifestcount = 0 :: non_neg_integer(),\n+         total_manifestcount = 0 :: non_neg_integer(),\n+         blockcount = 0 :: non_neg_integer()\n+        }).\n+\n+main([Host, Port0, RingSize0, MinSize0, OutputFile|_Rest]) ->\n+    Port = case Port0 of\n+               \"rel\" -> 8087;\n+               \"dev1\" -> 10018;\n+               _ -> list_to_integer(Port0)\n+           end,\n+    RingSize = list_to_integer(RingSize0),\n+    MinSize = list_to_integer(MinSize0),\n+    %% TODO: make this configurable, take leeway into account","path":"priv/tools/internal/select_gc_bucket.erl","position":47,"original_position":47,"commit_id":"c04cd57495369d064b48c8c424a6893459f5f489","original_commit_id":"c04cd57495369d064b48c8c424a6893459f5f489","user":{"login":"shino","id":10225,"avatar_url":"https://avatars.githubusercontent.com/u/10225?v=3","gravatar_id":"","url":"https://api.github.com/users/shino","html_url":"https://github.com/shino","followers_url":"https://api.github.com/users/shino/followers","following_url":"https://api.github.com/users/shino/following{/other_user}","gists_url":"https://api.github.com/users/shino/gists{/gist_id}","starred_url":"https://api.github.com/users/shino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shino/subscriptions","organizations_url":"https://api.github.com/users/shino/orgs","repos_url":"https://api.github.com/users/shino/repos","events_url":"https://api.github.com/users/shino/events{/privacy}","received_events_url":"https://api.github.com/users/shino/received_events","type":"User","site_admin":false},"body":"Agree. I think it's useful if we can specify start/end as options?","created_at":"2015-04-17T06:41:32Z","updated_at":"2015-04-17T06:41:32Z","html_url":"https://github.com/basho/riak_cs/pull/1124#discussion_r28572891","pull_request_url":"https://api.github.com/repos/basho/riak_cs/pulls/1124","_links":{"self":{"href":"https://api.github.com/repos/basho/riak_cs/pulls/comments/28572891"},"html":{"href":"https://github.com/basho/riak_cs/pull/1124#discussion_r28572891"},"pull_request":{"href":"https://api.github.com/repos/basho/riak_cs/pulls/1124"}}},"pull_request":{"url":"https://api.github.com/repos/basho/riak_cs/pulls/1124","id":33511503,"html_url":"https://github.com/basho/riak_cs/pull/1124","diff_url":"https://github.com/basho/riak_cs/pull/1124.diff","patch_url":"https://github.com/basho/riak_cs/pull/1124.patch","issue_url":"https://api.github.com/repos/basho/riak_cs/issues/1124","number":1124,"state":"open","locked":false,"title":"[wip] Feature/offline gc tool","user":{"login":"kuenishi","id":11440,"avatar_url":"https://avatars.githubusercontent.com/u/11440?v=3","gravatar_id":"","url":"https://api.github.com/users/kuenishi","html_url":"https://github.com/kuenishi","followers_url":"https://api.github.com/users/kuenishi/followers","following_url":"https://api.github.com/users/kuenishi/following{/other_user}","gists_url":"https://api.github.com/users/kuenishi/gists{/gist_id}","starred_url":"https://api.github.com/users/kuenishi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuenishi/subscriptions","organizations_url":"https://api.github.com/users/kuenishi/orgs","repos_url":"https://api.github.com/users/kuenishi/repos","events_url":"https://api.github.com/users/kuenishi/events{/privacy}","received_events_url":"https://api.github.com/users/kuenishi/received_events","type":"User","site_admin":false},"body":"Discussion topics:\r\n\r\n- how much does it work with old Bitcask old format?\r\n- performance?\r\n- bugs?","created_at":"2015-04-17T03:12:02Z","updated_at":"2015-04-17T06:41:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"407994161ef09d1eb1b1a8eadf955d9a46143aa5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/basho/riak_cs/pulls/1124/commits","review_comments_url":"https://api.github.com/repos/basho/riak_cs/pulls/1124/comments","review_comment_url":"https://api.github.com/repos/basho/riak_cs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/basho/riak_cs/issues/1124/comments","statuses_url":"https://api.github.com/repos/basho/riak_cs/statuses/c04cd57495369d064b48c8c424a6893459f5f489","head":{"label":"basho:feature/offline-gc-tool","ref":"feature/offline-gc-tool","sha":"c04cd57495369d064b48c8c424a6893459f5f489","user":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"repo":{"id":2513151,"name":"riak_cs","full_name":"basho/riak_cs","owner":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/basho/riak_cs","description":"Riak CS is simple, available cloud storage built on Riak.","fork":false,"url":"https://api.github.com/repos/basho/riak_cs","forks_url":"https://api.github.com/repos/basho/riak_cs/forks","keys_url":"https://api.github.com/repos/basho/riak_cs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basho/riak_cs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basho/riak_cs/teams","hooks_url":"https://api.github.com/repos/basho/riak_cs/hooks","issue_events_url":"https://api.github.com/repos/basho/riak_cs/issues/events{/number}","events_url":"https://api.github.com/repos/basho/riak_cs/events","assignees_url":"https://api.github.com/repos/basho/riak_cs/assignees{/user}","branches_url":"https://api.github.com/repos/basho/riak_cs/branches{/branch}","tags_url":"https://api.github.com/repos/basho/riak_cs/tags","blobs_url":"https://api.github.com/repos/basho/riak_cs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basho/riak_cs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basho/riak_cs/git/refs{/sha}","trees_url":"https://api.github.com/repos/basho/riak_cs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basho/riak_cs/statuses/{sha}","languages_url":"https://api.github.com/repos/basho/riak_cs/languages","stargazers_url":"https://api.github.com/repos/basho/riak_cs/stargazers","contributors_url":"https://api.github.com/repos/basho/riak_cs/contributors","subscribers_url":"https://api.github.com/repos/basho/riak_cs/subscribers","subscription_url":"https://api.github.com/repos/basho/riak_cs/subscription","commits_url":"https://api.github.com/repos/basho/riak_cs/commits{/sha}","git_commits_url":"https://api.github.com/repos/basho/riak_cs/git/commits{/sha}","comments_url":"https://api.github.com/repos/basho/riak_cs/comments{/number}","issue_comment_url":"https://api.github.com/repos/basho/riak_cs/issues/comments{/number}","contents_url":"https://api.github.com/repos/basho/riak_cs/contents/{+path}","compare_url":"https://api.github.com/repos/basho/riak_cs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basho/riak_cs/merges","archive_url":"https://api.github.com/repos/basho/riak_cs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basho/riak_cs/downloads","issues_url":"https://api.github.com/repos/basho/riak_cs/issues{/number}","pulls_url":"https://api.github.com/repos/basho/riak_cs/pulls{/number}","milestones_url":"https://api.github.com/repos/basho/riak_cs/milestones{/number}","notifications_url":"https://api.github.com/repos/basho/riak_cs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basho/riak_cs/labels{/name}","releases_url":"https://api.github.com/repos/basho/riak_cs/releases{/id}","created_at":"2011-10-04T16:16:25Z","updated_at":"2015-04-16T15:24:01Z","pushed_at":"2015-04-17T04:10:07Z","git_url":"git://github.com/basho/riak_cs.git","ssh_url":"git@github.com:basho/riak_cs.git","clone_url":"https://github.com/basho/riak_cs.git","svn_url":"https://github.com/basho/riak_cs","homepage":"http://docs.basho.com/riakcs/latest/","size":22876,"stargazers_count":365,"watchers_count":365,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":143,"forks":54,"open_issues":143,"watchers":365,"default_branch":"develop"}},"base":{"label":"basho:2.0","ref":"2.0","sha":"aa245333267a41fe8b03633eb233ccc49aadb19c","user":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"repo":{"id":2513151,"name":"riak_cs","full_name":"basho/riak_cs","owner":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/basho/riak_cs","description":"Riak CS is simple, available cloud storage built on Riak.","fork":false,"url":"https://api.github.com/repos/basho/riak_cs","forks_url":"https://api.github.com/repos/basho/riak_cs/forks","keys_url":"https://api.github.com/repos/basho/riak_cs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basho/riak_cs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basho/riak_cs/teams","hooks_url":"https://api.github.com/repos/basho/riak_cs/hooks","issue_events_url":"https://api.github.com/repos/basho/riak_cs/issues/events{/number}","events_url":"https://api.github.com/repos/basho/riak_cs/events","assignees_url":"https://api.github.com/repos/basho/riak_cs/assignees{/user}","branches_url":"https://api.github.com/repos/basho/riak_cs/branches{/branch}","tags_url":"https://api.github.com/repos/basho/riak_cs/tags","blobs_url":"https://api.github.com/repos/basho/riak_cs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basho/riak_cs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basho/riak_cs/git/refs{/sha}","trees_url":"https://api.github.com/repos/basho/riak_cs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basho/riak_cs/statuses/{sha}","languages_url":"https://api.github.com/repos/basho/riak_cs/languages","stargazers_url":"https://api.github.com/repos/basho/riak_cs/stargazers","contributors_url":"https://api.github.com/repos/basho/riak_cs/contributors","subscribers_url":"https://api.github.com/repos/basho/riak_cs/subscribers","subscription_url":"https://api.github.com/repos/basho/riak_cs/subscription","commits_url":"https://api.github.com/repos/basho/riak_cs/commits{/sha}","git_commits_url":"https://api.github.com/repos/basho/riak_cs/git/commits{/sha}","comments_url":"https://api.github.com/repos/basho/riak_cs/comments{/number}","issue_comment_url":"https://api.github.com/repos/basho/riak_cs/issues/comments{/number}","contents_url":"https://api.github.com/repos/basho/riak_cs/contents/{+path}","compare_url":"https://api.github.com/repos/basho/riak_cs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basho/riak_cs/merges","archive_url":"https://api.github.com/repos/basho/riak_cs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basho/riak_cs/downloads","issues_url":"https://api.github.com/repos/basho/riak_cs/issues{/number}","pulls_url":"https://api.github.com/repos/basho/riak_cs/pulls{/number}","milestones_url":"https://api.github.com/repos/basho/riak_cs/milestones{/number}","notifications_url":"https://api.github.com/repos/basho/riak_cs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basho/riak_cs/labels{/name}","releases_url":"https://api.github.com/repos/basho/riak_cs/releases{/id}","created_at":"2011-10-04T16:16:25Z","updated_at":"2015-04-16T15:24:01Z","pushed_at":"2015-04-17T04:10:07Z","git_url":"git://github.com/basho/riak_cs.git","ssh_url":"git@github.com:basho/riak_cs.git","clone_url":"https://github.com/basho/riak_cs.git","svn_url":"https://github.com/basho/riak_cs","homepage":"http://docs.basho.com/riakcs/latest/","size":22876,"stargazers_count":365,"watchers_count":365,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":143,"forks":54,"open_issues":143,"watchers":365,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/basho/riak_cs/pulls/1124"},"html":{"href":"https://github.com/basho/riak_cs/pull/1124"},"issue":{"href":"https://api.github.com/repos/basho/riak_cs/issues/1124"},"comments":{"href":"https://api.github.com/repos/basho/riak_cs/issues/1124/comments"},"review_comments":{"href":"https://api.github.com/repos/basho/riak_cs/pulls/1124/comments"},"review_comment":{"href":"https://api.github.com/repos/basho/riak_cs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/basho/riak_cs/pulls/1124/commits"},"statuses":{"href":"https://api.github.com/repos/basho/riak_cs/statuses/c04cd57495369d064b48c8c424a6893459f5f489"}}}}