{"action":"created","comment":{"url":"https://api.github.com/repos/baidu/tera/pulls/comments/50218097","id":50218097,"diff_hunk":"@@ -249,8 +261,12 @@ int ShowKv(tera::Client* client) {\n /// 演示程序\n int main(int argc, char* argv[]) {\n     tera::ErrorCode error_code;\n+    std::string flag_file = \"./tera.flag\";\n+    if (argc >= 2) {\n+        flag_file = argv[1];\n+    }\n     // 根据配置创建一个client\n-    tera::Client* client = tera::Client::NewClient(\"./tera.flag\", \"tera_sample\", &error_code);\n+    tera::Client* client = tera::Client::NewClient(flag_file, \"tera_sample\", &error_code);\n     if (client == NULL) {\n         printf(\"Create tera client fail: %s\\n\", tera::strerr(error_code));\n         return 1;","path":"src/sample/tera_sample.cc","position":58,"original_position":58,"commit_id":"2c33fb8afe2dbc2e46b9bf628b9b3f93ae0452b9","original_commit_id":"cdbadd64593e9047acef7ed06a77e65bbf392e8f","user":{"login":"stevenswong","id":1772676,"avatar_url":"https://avatars.githubusercontent.com/u/1772676?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenswong","html_url":"https://github.com/stevenswong","followers_url":"https://api.github.com/users/stevenswong/followers","following_url":"https://api.github.com/users/stevenswong/following{/other_user}","gists_url":"https://api.github.com/users/stevenswong/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenswong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenswong/subscriptions","organizations_url":"https://api.github.com/users/stevenswong/orgs","repos_url":"https://api.github.com/users/stevenswong/repos","events_url":"https://api.github.com/users/stevenswong/events{/privacy}","received_events_url":"https://api.github.com/users/stevenswong/received_events","type":"User","site_admin":false},"body":"新提交的代码里，为teracli增加other_flagfiles配置，支持teracli操作多个tera集群","created_at":"2016-01-20T06:11:10Z","updated_at":"2016-01-20T06:11:10Z","html_url":"https://github.com/baidu/tera/pull/692#discussion_r50218097","pull_request_url":"https://api.github.com/repos/baidu/tera/pulls/692","_links":{"self":{"href":"https://api.github.com/repos/baidu/tera/pulls/comments/50218097"},"html":{"href":"https://github.com/baidu/tera/pull/692#discussion_r50218097"},"pull_request":{"href":"https://api.github.com/repos/baidu/tera/pulls/692"}}},"pull_request":{"url":"https://api.github.com/repos/baidu/tera/pulls/692","id":55583023,"html_url":"https://github.com/baidu/tera/pull/692","diff_url":"https://github.com/baidu/tera/pull/692.diff","patch_url":"https://github.com/baidu/tera/pull/692.patch","issue_url":"https://api.github.com/repos/baidu/tera/issues/692","number":692,"state":"open","locked":false,"title":"tera sdk热备功能","user":{"login":"stevenswong","id":1772676,"avatar_url":"https://avatars.githubusercontent.com/u/1772676?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenswong","html_url":"https://github.com/stevenswong","followers_url":"https://api.github.com/users/stevenswong/followers","following_url":"https://api.github.com/users/stevenswong/following{/other_user}","gists_url":"https://api.github.com/users/stevenswong/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenswong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenswong/subscriptions","organizations_url":"https://api.github.com/users/stevenswong/orgs","repos_url":"https://api.github.com/users/stevenswong/repos","events_url":"https://api.github.com/users/stevenswong/events{/privacy}","received_events_url":"https://api.github.com/users/stevenswong/received_events","type":"User","site_admin":false},"body":"实现：\r\n1. 写操作：数据顺序写到两个tera集群里，只要写一个成功，sdk就返回成功；\r\n2. 读操作：优先读第一个tera集群，成功则返回，失败则读下一个tera集群；\r\n\r\n目前存在的问题：\r\n1. 读操作的SDK是否需要返回数据来自哪个集群信息？\r\n2. 写操作的SDK是否需要返回写哪个集群成功，哪个集群失败的信息？","created_at":"2016-01-11T02:53:21Z","updated_at":"2016-01-20T06:11:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"956b0c802fc75f1cb87818145064bbd232ab7560","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/baidu/tera/pulls/692/commits","review_comments_url":"https://api.github.com/repos/baidu/tera/pulls/692/comments","review_comment_url":"https://api.github.com/repos/baidu/tera/pulls/comments{/number}","comments_url":"https://api.github.com/repos/baidu/tera/issues/692/comments","statuses_url":"https://api.github.com/repos/baidu/tera/statuses/2c33fb8afe2dbc2e46b9bf628b9b3f93ae0452b9","head":{"label":"stevenswong:multi-RW-sdk","ref":"multi-RW-sdk","sha":"2c33fb8afe2dbc2e46b9bf628b9b3f93ae0452b9","user":{"login":"stevenswong","id":1772676,"avatar_url":"https://avatars.githubusercontent.com/u/1772676?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenswong","html_url":"https://github.com/stevenswong","followers_url":"https://api.github.com/users/stevenswong/followers","following_url":"https://api.github.com/users/stevenswong/following{/other_user}","gists_url":"https://api.github.com/users/stevenswong/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenswong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenswong/subscriptions","organizations_url":"https://api.github.com/users/stevenswong/orgs","repos_url":"https://api.github.com/users/stevenswong/repos","events_url":"https://api.github.com/users/stevenswong/events{/privacy}","received_events_url":"https://api.github.com/users/stevenswong/received_events","type":"User","site_admin":false},"repo":{"id":47815016,"name":"tera","full_name":"stevenswong/tera","owner":{"login":"stevenswong","id":1772676,"avatar_url":"https://avatars.githubusercontent.com/u/1772676?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenswong","html_url":"https://github.com/stevenswong","followers_url":"https://api.github.com/users/stevenswong/followers","following_url":"https://api.github.com/users/stevenswong/following{/other_user}","gists_url":"https://api.github.com/users/stevenswong/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenswong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenswong/subscriptions","organizations_url":"https://api.github.com/users/stevenswong/orgs","repos_url":"https://api.github.com/users/stevenswong/repos","events_url":"https://api.github.com/users/stevenswong/events{/privacy}","received_events_url":"https://api.github.com/users/stevenswong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stevenswong/tera","description":"A distributed, elastic, structured database.","fork":true,"url":"https://api.github.com/repos/stevenswong/tera","forks_url":"https://api.github.com/repos/stevenswong/tera/forks","keys_url":"https://api.github.com/repos/stevenswong/tera/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stevenswong/tera/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stevenswong/tera/teams","hooks_url":"https://api.github.com/repos/stevenswong/tera/hooks","issue_events_url":"https://api.github.com/repos/stevenswong/tera/issues/events{/number}","events_url":"https://api.github.com/repos/stevenswong/tera/events","assignees_url":"https://api.github.com/repos/stevenswong/tera/assignees{/user}","branches_url":"https://api.github.com/repos/stevenswong/tera/branches{/branch}","tags_url":"https://api.github.com/repos/stevenswong/tera/tags","blobs_url":"https://api.github.com/repos/stevenswong/tera/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stevenswong/tera/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stevenswong/tera/git/refs{/sha}","trees_url":"https://api.github.com/repos/stevenswong/tera/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stevenswong/tera/statuses/{sha}","languages_url":"https://api.github.com/repos/stevenswong/tera/languages","stargazers_url":"https://api.github.com/repos/stevenswong/tera/stargazers","contributors_url":"https://api.github.com/repos/stevenswong/tera/contributors","subscribers_url":"https://api.github.com/repos/stevenswong/tera/subscribers","subscription_url":"https://api.github.com/repos/stevenswong/tera/subscription","commits_url":"https://api.github.com/repos/stevenswong/tera/commits{/sha}","git_commits_url":"https://api.github.com/repos/stevenswong/tera/git/commits{/sha}","comments_url":"https://api.github.com/repos/stevenswong/tera/comments{/number}","issue_comment_url":"https://api.github.com/repos/stevenswong/tera/issues/comments{/number}","contents_url":"https://api.github.com/repos/stevenswong/tera/contents/{+path}","compare_url":"https://api.github.com/repos/stevenswong/tera/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stevenswong/tera/merges","archive_url":"https://api.github.com/repos/stevenswong/tera/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stevenswong/tera/downloads","issues_url":"https://api.github.com/repos/stevenswong/tera/issues{/number}","pulls_url":"https://api.github.com/repos/stevenswong/tera/pulls{/number}","milestones_url":"https://api.github.com/repos/stevenswong/tera/milestones{/number}","notifications_url":"https://api.github.com/repos/stevenswong/tera/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stevenswong/tera/labels{/name}","releases_url":"https://api.github.com/repos/stevenswong/tera/releases{/id}","created_at":"2015-12-11T08:41:20Z","updated_at":"2016-01-19T08:12:46Z","pushed_at":"2016-01-20T02:41:00Z","git_url":"git://github.com/stevenswong/tera.git","ssh_url":"git@github.com:stevenswong/tera.git","clone_url":"https://github.com/stevenswong/tera.git","svn_url":"https://github.com/stevenswong/tera","homepage":"","size":13569,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"baidu:master","ref":"master","sha":"1e92a81a59291d0122bdac6de663acfafef5317e","user":{"login":"baidu","id":13245940,"avatar_url":"https://avatars.githubusercontent.com/u/13245940?v=3","gravatar_id":"","url":"https://api.github.com/users/baidu","html_url":"https://github.com/baidu","followers_url":"https://api.github.com/users/baidu/followers","following_url":"https://api.github.com/users/baidu/following{/other_user}","gists_url":"https://api.github.com/users/baidu/gists{/gist_id}","starred_url":"https://api.github.com/users/baidu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baidu/subscriptions","organizations_url":"https://api.github.com/users/baidu/orgs","repos_url":"https://api.github.com/users/baidu/repos","events_url":"https://api.github.com/users/baidu/events{/privacy}","received_events_url":"https://api.github.com/users/baidu/received_events","type":"Organization","site_admin":false},"repo":{"id":18129915,"name":"tera","full_name":"baidu/tera","owner":{"login":"baidu","id":13245940,"avatar_url":"https://avatars.githubusercontent.com/u/13245940?v=3","gravatar_id":"","url":"https://api.github.com/users/baidu","html_url":"https://github.com/baidu","followers_url":"https://api.github.com/users/baidu/followers","following_url":"https://api.github.com/users/baidu/following{/other_user}","gists_url":"https://api.github.com/users/baidu/gists{/gist_id}","starred_url":"https://api.github.com/users/baidu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baidu/subscriptions","organizations_url":"https://api.github.com/users/baidu/orgs","repos_url":"https://api.github.com/users/baidu/repos","events_url":"https://api.github.com/users/baidu/events{/privacy}","received_events_url":"https://api.github.com/users/baidu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/baidu/tera","description":"A distributed, elastic, structured database.","fork":false,"url":"https://api.github.com/repos/baidu/tera","forks_url":"https://api.github.com/repos/baidu/tera/forks","keys_url":"https://api.github.com/repos/baidu/tera/keys{/key_id}","collaborators_url":"https://api.github.com/repos/baidu/tera/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/baidu/tera/teams","hooks_url":"https://api.github.com/repos/baidu/tera/hooks","issue_events_url":"https://api.github.com/repos/baidu/tera/issues/events{/number}","events_url":"https://api.github.com/repos/baidu/tera/events","assignees_url":"https://api.github.com/repos/baidu/tera/assignees{/user}","branches_url":"https://api.github.com/repos/baidu/tera/branches{/branch}","tags_url":"https://api.github.com/repos/baidu/tera/tags","blobs_url":"https://api.github.com/repos/baidu/tera/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/baidu/tera/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/baidu/tera/git/refs{/sha}","trees_url":"https://api.github.com/repos/baidu/tera/git/trees{/sha}","statuses_url":"https://api.github.com/repos/baidu/tera/statuses/{sha}","languages_url":"https://api.github.com/repos/baidu/tera/languages","stargazers_url":"https://api.github.com/repos/baidu/tera/stargazers","contributors_url":"https://api.github.com/repos/baidu/tera/contributors","subscribers_url":"https://api.github.com/repos/baidu/tera/subscribers","subscription_url":"https://api.github.com/repos/baidu/tera/subscription","commits_url":"https://api.github.com/repos/baidu/tera/commits{/sha}","git_commits_url":"https://api.github.com/repos/baidu/tera/git/commits{/sha}","comments_url":"https://api.github.com/repos/baidu/tera/comments{/number}","issue_comment_url":"https://api.github.com/repos/baidu/tera/issues/comments{/number}","contents_url":"https://api.github.com/repos/baidu/tera/contents/{+path}","compare_url":"https://api.github.com/repos/baidu/tera/compare/{base}...{head}","merges_url":"https://api.github.com/repos/baidu/tera/merges","archive_url":"https://api.github.com/repos/baidu/tera/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/baidu/tera/downloads","issues_url":"https://api.github.com/repos/baidu/tera/issues{/number}","pulls_url":"https://api.github.com/repos/baidu/tera/pulls{/number}","milestones_url":"https://api.github.com/repos/baidu/tera/milestones{/number}","notifications_url":"https://api.github.com/repos/baidu/tera/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/baidu/tera/labels{/name}","releases_url":"https://api.github.com/repos/baidu/tera/releases{/id}","created_at":"2014-03-26T07:22:05Z","updated_at":"2016-01-18T18:36:31Z","pushed_at":"2016-01-20T02:41:01Z","git_url":"git://github.com/baidu/tera.git","ssh_url":"git@github.com:baidu/tera.git","clone_url":"https://github.com/baidu/tera.git","svn_url":"https://github.com/baidu/tera","homepage":"","size":16452,"stargazers_count":347,"watchers_count":347,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":116,"mirror_url":null,"open_issues_count":128,"forks":116,"open_issues":128,"watchers":347,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/baidu/tera/pulls/692"},"html":{"href":"https://github.com/baidu/tera/pull/692"},"issue":{"href":"https://api.github.com/repos/baidu/tera/issues/692"},"comments":{"href":"https://api.github.com/repos/baidu/tera/issues/692/comments"},"review_comments":{"href":"https://api.github.com/repos/baidu/tera/pulls/692/comments"},"review_comment":{"href":"https://api.github.com/repos/baidu/tera/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/baidu/tera/pulls/692/commits"},"statuses":{"href":"https://api.github.com/repos/baidu/tera/statuses/2c33fb8afe2dbc2e46b9bf628b9b3f93ae0452b9"}}}}