{"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/tikv/pulls/comments/83824601","pull_request_review_id":4639472,"id":83824601,"diff_hunk":"@@ -0,0 +1,193 @@\n+// Copyright 2016 PingCAP, Inc.\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+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+#![feature(plugin)]\n+#![cfg_attr(feature = \"dev\", plugin(clippy))]\n+\n+extern crate tikv;\n+extern crate clap;\n+extern crate protobuf;\n+extern crate kvproto;\n+extern crate rocksdb;\n+\n+use std::{str, u64};\n+use clap::{Arg, App, SubCommand};\n+use protobuf::Message;\n+use kvproto::raft_cmdpb::RaftCmdRequest;\n+use kvproto::raft_serverpb::{RaftLocalState, RegionLocalState, RaftApplyState};\n+use kvproto::eraftpb::Entry;\n+use rocksdb::DB;\n+use tikv::util::{self, escape, unescape};\n+use tikv::raftstore::store::keys;\n+use tikv::raftstore::store::engine::{Peekable, Iterable};\n+use tikv::storage::{ALL_CFS, CF_RAFT};\n+\n+static VERSION: &'static str = \"0.0.1\";\n+const DEFAULT_TO: Vec<i32> = vec![0xff];\n+\n+fn main() {\n+    let matches = App::new(\"tikv\")\n+        .version(VERSION)\n+        .author(\"PingCAP\")\n+        .about(\"Distributed transactional key value database powered by Rust and Raft\")\n+        .arg(Arg::with_name(\"db\")\n+             .short(\"d\")\n+             .takes_value(true)\n+             .help(\"set rocksdb path, required\"))\n+        .subcommand(SubCommand::with_name(\"raft\")\n+                    .about(\"print raft log entry\")\n+                    .version(VERSION)\n+                    .subcommand(Subcommand::with_name(\"log\")\n+                                .about(\"print the raft log entry info\")\n+                                .version(VERSION)\n+                                .arg(Arg::with_name(\"region\")\n+                                     .short(\"r\")\n+                                     .takes_value(true)\n+                                     .help(\"set the region id, required when get raft message\"))","path":"src/bin/tikv-ctl.rs","position":56,"original_position":56,"commit_id":"f3dce43ce66c30639a2ac73906aef698b55e9fc5","original_commit_id":"f3dce43ce66c30639a2ac73906aef698b55e9fc5","user":{"login":"BusyJay","id":1701473,"avatar_url":"https://avatars.githubusercontent.com/u/1701473?v=3","gravatar_id":"","url":"https://api.github.com/users/BusyJay","html_url":"https://github.com/BusyJay","followers_url":"https://api.github.com/users/BusyJay/followers","following_url":"https://api.github.com/users/BusyJay/following{/other_user}","gists_url":"https://api.github.com/users/BusyJay/gists{/gist_id}","starred_url":"https://api.github.com/users/BusyJay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BusyJay/subscriptions","organizations_url":"https://api.github.com/users/BusyJay/orgs","repos_url":"https://api.github.com/users/BusyJay/repos","events_url":"https://api.github.com/users/BusyJay/events{/privacy}","received_events_url":"https://api.github.com/users/BusyJay/received_events","type":"User","site_admin":false},"body":"The help message is outdated.","created_at":"2016-10-18T10:27:01Z","updated_at":"2016-10-18T10:27:01Z","html_url":"https://github.com/pingcap/tikv/pull/1163#discussion_r83824601","pull_request_url":"https://api.github.com/repos/pingcap/tikv/pulls/1163","_links":{"self":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/comments/83824601"},"html":{"href":"https://github.com/pingcap/tikv/pull/1163#discussion_r83824601"},"pull_request":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/1163"}}},"pull_request":{"url":"https://api.github.com/repos/pingcap/tikv/pulls/1163","id":88947344,"html_url":"https://github.com/pingcap/tikv/pull/1163","diff_url":"https://github.com/pingcap/tikv/pull/1163.diff","patch_url":"https://github.com/pingcap/tikv/pull/1163.patch","issue_url":"https://api.github.com/repos/pingcap/tikv/issues/1163","number":1163,"state":"open","locked":false,"title":"add tikv-ctl","user":{"login":"mrmiywj","id":7459820,"avatar_url":"https://avatars.githubusercontent.com/u/7459820?v=3","gravatar_id":"","url":"https://api.github.com/users/mrmiywj","html_url":"https://github.com/mrmiywj","followers_url":"https://api.github.com/users/mrmiywj/followers","following_url":"https://api.github.com/users/mrmiywj/following{/other_user}","gists_url":"https://api.github.com/users/mrmiywj/gists{/gist_id}","starred_url":"https://api.github.com/users/mrmiywj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrmiywj/subscriptions","organizations_url":"https://api.github.com/users/mrmiywj/orgs","repos_url":"https://api.github.com/users/mrmiywj/repos","events_url":"https://api.github.com/users/mrmiywj/events{/privacy}","received_events_url":"https://api.github.com/users/mrmiywj/received_events","type":"User","site_admin":false},"body":"Add a tool `tikv-ctl` #946 ","created_at":"2016-10-12T03:19:30Z","updated_at":"2016-10-18T10:37:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0a13f0f27d0eb0545e982f50b435d07a7d387e0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/tikv/pulls/1163/commits","review_comments_url":"https://api.github.com/repos/pingcap/tikv/pulls/1163/comments","review_comment_url":"https://api.github.com/repos/pingcap/tikv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/tikv/issues/1163/comments","statuses_url":"https://api.github.com/repos/pingcap/tikv/statuses/f3dce43ce66c30639a2ac73906aef698b55e9fc5","head":{"label":"mrmiywj:tikv-ctl","ref":"tikv-ctl","sha":"f3dce43ce66c30639a2ac73906aef698b55e9fc5","user":{"login":"mrmiywj","id":7459820,"avatar_url":"https://avatars.githubusercontent.com/u/7459820?v=3","gravatar_id":"","url":"https://api.github.com/users/mrmiywj","html_url":"https://github.com/mrmiywj","followers_url":"https://api.github.com/users/mrmiywj/followers","following_url":"https://api.github.com/users/mrmiywj/following{/other_user}","gists_url":"https://api.github.com/users/mrmiywj/gists{/gist_id}","starred_url":"https://api.github.com/users/mrmiywj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrmiywj/subscriptions","organizations_url":"https://api.github.com/users/mrmiywj/orgs","repos_url":"https://api.github.com/users/mrmiywj/repos","events_url":"https://api.github.com/users/mrmiywj/events{/privacy}","received_events_url":"https://api.github.com/users/mrmiywj/received_events","type":"User","site_admin":false},"repo":{"id":70453970,"name":"tikv","full_name":"mrmiywj/tikv","owner":{"login":"mrmiywj","id":7459820,"avatar_url":"https://avatars.githubusercontent.com/u/7459820?v=3","gravatar_id":"","url":"https://api.github.com/users/mrmiywj","html_url":"https://github.com/mrmiywj","followers_url":"https://api.github.com/users/mrmiywj/followers","following_url":"https://api.github.com/users/mrmiywj/following{/other_user}","gists_url":"https://api.github.com/users/mrmiywj/gists{/gist_id}","starred_url":"https://api.github.com/users/mrmiywj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrmiywj/subscriptions","organizations_url":"https://api.github.com/users/mrmiywj/orgs","repos_url":"https://api.github.com/users/mrmiywj/repos","events_url":"https://api.github.com/users/mrmiywj/events{/privacy}","received_events_url":"https://api.github.com/users/mrmiywj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrmiywj/tikv","description":"Distributed transactional key value database powered by Rust and Raft","fork":true,"url":"https://api.github.com/repos/mrmiywj/tikv","forks_url":"https://api.github.com/repos/mrmiywj/tikv/forks","keys_url":"https://api.github.com/repos/mrmiywj/tikv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrmiywj/tikv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrmiywj/tikv/teams","hooks_url":"https://api.github.com/repos/mrmiywj/tikv/hooks","issue_events_url":"https://api.github.com/repos/mrmiywj/tikv/issues/events{/number}","events_url":"https://api.github.com/repos/mrmiywj/tikv/events","assignees_url":"https://api.github.com/repos/mrmiywj/tikv/assignees{/user}","branches_url":"https://api.github.com/repos/mrmiywj/tikv/branches{/branch}","tags_url":"https://api.github.com/repos/mrmiywj/tikv/tags","blobs_url":"https://api.github.com/repos/mrmiywj/tikv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrmiywj/tikv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrmiywj/tikv/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrmiywj/tikv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrmiywj/tikv/statuses/{sha}","languages_url":"https://api.github.com/repos/mrmiywj/tikv/languages","stargazers_url":"https://api.github.com/repos/mrmiywj/tikv/stargazers","contributors_url":"https://api.github.com/repos/mrmiywj/tikv/contributors","subscribers_url":"https://api.github.com/repos/mrmiywj/tikv/subscribers","subscription_url":"https://api.github.com/repos/mrmiywj/tikv/subscription","commits_url":"https://api.github.com/repos/mrmiywj/tikv/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrmiywj/tikv/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrmiywj/tikv/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrmiywj/tikv/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrmiywj/tikv/contents/{+path}","compare_url":"https://api.github.com/repos/mrmiywj/tikv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrmiywj/tikv/merges","archive_url":"https://api.github.com/repos/mrmiywj/tikv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrmiywj/tikv/downloads","issues_url":"https://api.github.com/repos/mrmiywj/tikv/issues{/number}","pulls_url":"https://api.github.com/repos/mrmiywj/tikv/pulls{/number}","milestones_url":"https://api.github.com/repos/mrmiywj/tikv/milestones{/number}","notifications_url":"https://api.github.com/repos/mrmiywj/tikv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrmiywj/tikv/labels{/name}","releases_url":"https://api.github.com/repos/mrmiywj/tikv/releases{/id}","deployments_url":"https://api.github.com/repos/mrmiywj/tikv/deployments","created_at":"2016-10-10T05:11:56Z","updated_at":"2016-10-10T05:11:59Z","pushed_at":"2016-10-17T04:56:44Z","git_url":"git://github.com/mrmiywj/tikv.git","ssh_url":"git@github.com:mrmiywj/tikv.git","clone_url":"https://github.com/mrmiywj/tikv.git","svn_url":"https://github.com/mrmiywj/tikv","homepage":"","size":4754,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"pingcap:master","ref":"master","sha":"3f5145fb247850d754301d59bee074a709b662f4","user":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars.githubusercontent.com/u/11855343?v=3","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"repo":{"id":48833910,"name":"tikv","full_name":"pingcap/tikv","owner":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars.githubusercontent.com/u/11855343?v=3","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pingcap/tikv","description":"Distributed transactional key value database powered by Rust and Raft","fork":false,"url":"https://api.github.com/repos/pingcap/tikv","forks_url":"https://api.github.com/repos/pingcap/tikv/forks","keys_url":"https://api.github.com/repos/pingcap/tikv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/tikv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/tikv/teams","hooks_url":"https://api.github.com/repos/pingcap/tikv/hooks","issue_events_url":"https://api.github.com/repos/pingcap/tikv/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/tikv/events","assignees_url":"https://api.github.com/repos/pingcap/tikv/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/tikv/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/tikv/tags","blobs_url":"https://api.github.com/repos/pingcap/tikv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/tikv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/tikv/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/tikv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/tikv/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/tikv/languages","stargazers_url":"https://api.github.com/repos/pingcap/tikv/stargazers","contributors_url":"https://api.github.com/repos/pingcap/tikv/contributors","subscribers_url":"https://api.github.com/repos/pingcap/tikv/subscribers","subscription_url":"https://api.github.com/repos/pingcap/tikv/subscription","commits_url":"https://api.github.com/repos/pingcap/tikv/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/tikv/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/tikv/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/tikv/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/tikv/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/tikv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/tikv/merges","archive_url":"https://api.github.com/repos/pingcap/tikv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/tikv/downloads","issues_url":"https://api.github.com/repos/pingcap/tikv/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/tikv/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/tikv/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/tikv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/tikv/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/tikv/releases{/id}","deployments_url":"https://api.github.com/repos/pingcap/tikv/deployments","created_at":"2015-12-31T04:51:32Z","updated_at":"2016-10-18T08:01:41Z","pushed_at":"2016-10-18T08:42:04Z","git_url":"git://github.com/pingcap/tikv.git","ssh_url":"git@github.com:pingcap/tikv.git","clone_url":"https://github.com/pingcap/tikv.git","svn_url":"https://github.com/pingcap/tikv","homepage":"","size":6530,"stargazers_count":1094,"watchers_count":1094,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":92,"mirror_url":null,"open_issues_count":63,"forks":92,"open_issues":63,"watchers":1094,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/1163"},"html":{"href":"https://github.com/pingcap/tikv/pull/1163"},"issue":{"href":"https://api.github.com/repos/pingcap/tikv/issues/1163"},"comments":{"href":"https://api.github.com/repos/pingcap/tikv/issues/1163/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/1163/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/tikv/pulls/1163/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/tikv/statuses/f3dce43ce66c30639a2ac73906aef698b55e9fc5"}}}}
{"actor":{"display_login":"BusyJay"}}