{"action":"created","comment":{"url":"https://api.github.com/repos/baidu/tera/pulls/comments/75427580","id":75427580,"diff_hunk":"@@ -0,0 +1,108 @@\n+# RowMutation\n+\n+tera sdk中通过RowMutation结构描述一次行更新操作，包含删除操作。\n+一个RowMutaion中可以同时对多列进行操作，保证：\n+ * 服务端生效时序与RowMutation的执行时序相同。比如对某列的删除+更新，服务端生效时不会乱序，导致先更新再删除的情况发生。\n+ * 同一个RowMutation中的操作保证同时成功或失败。\n+ * 操作不存在的列会返回成功，但无法读取。\n+\n+## 创建与析构\n+\n+由tera::Table::NewRowMutation创建，不能由用户创建。\n+\n+用户需要自行析构：\n+ * 同步模式下Put返回后即可析构\n+ * 异步模式下需要等待回调返回，并处理完成后析构，建议在回调函数末尾进行析构\n+ \n+## API\n+\n+### 更新\n+\n+Key-value模式更新。若设定ttl，数据会在ttl时间超时后被淘汰。\n+```\n+void Put(const std::string& value, int32_t ttl = -1);\n+```\n+表格模式更新。若设定timestamp，数据会被更新至指定时间，危险，不建议使用。\n+```\n+void Put(const std::string& family, const std::string& qualifier, const std::string& value, int64_t timestamp = -1);\n+```\n+表格模式更新。Counter场景下使用，设定初始值\n+```\n+void Put(const std::string& family, const std::string& qualifier, int64_t value, int64_t timestamp = -1);\n+```\n+表格模式更新。Counter场景下使用，累加。\n+```\n+void Add(const std::string& family, const std::string& qualifier, const int64_t delta);\n+```\n+表格模式更新。若不存在，更新生效；否则更新数据不生效。\n+```\n+void PutIfAbsent(const std::string& family, const std::string& qualifier, const std::string& value);\n+```\n+表格模式更新。将value追加至此列原数据末尾。\n+```\n+void Append(const std::string& family, const std::string& qualifier, const std::string& value);\n+```\n+\n+### 删除\n+\n+删除整行。若设定timestamp，则删除此时间之前的所有更新。\n+Key-value模式下timestamp不生效。\n+```\n+void DeleteRow(int64_t timestamp = -1);\n+```\n+删除某列族。若设定timestamp，则删除此时间之前的所有更新。\n+```\n+void DeleteFamily(const std::string& family, int64_t timestamp = -1);\n+```\n+删除某列所有版本。若设定timestamp，则删除此时间之前的所有更新。\n+```\n+void DeleteColumns(const std::string& family, const std::string& qualifier, int64_t timestamp = -1);\n+```\n+删除某列指定时间更新。","path":"doc/sdk_reference/mutation.md","position":59,"original_position":61,"commit_id":"31fea970888437a7e52ab475831df834ea86d09c","original_commit_id":"31fea970888437a7e52ab475831df834ea86d09c","user":{"login":"00k","id":9716419,"avatar_url":"https://avatars.githubusercontent.com/u/9716419?v=3","gravatar_id":"","url":"https://api.github.com/users/00k","html_url":"https://github.com/00k","followers_url":"https://api.github.com/users/00k/followers","following_url":"https://api.github.com/users/00k/following{/other_user}","gists_url":"https://api.github.com/users/00k/gists{/gist_id}","starred_url":"https://api.github.com/users/00k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/00k/subscriptions","organizations_url":"https://api.github.com/users/00k/orgs","repos_url":"https://api.github.com/users/00k/repos","events_url":"https://api.github.com/users/00k/events{/privacy}","received_events_url":"https://api.github.com/users/00k/received_events","type":"User","site_admin":false},"body":"删除某列的指定版本\r\n这样更好懂","created_at":"2016-08-19T04:58:47Z","updated_at":"2016-08-19T04:58:47Z","html_url":"https://github.com/baidu/tera/pull/971#discussion_r75427580","pull_request_url":"https://api.github.com/repos/baidu/tera/pulls/971","_links":{"self":{"href":"https://api.github.com/repos/baidu/tera/pulls/comments/75427580"},"html":{"href":"https://github.com/baidu/tera/pull/971#discussion_r75427580"},"pull_request":{"href":"https://api.github.com/repos/baidu/tera/pulls/971"}}},"pull_request":{"url":"https://api.github.com/repos/baidu/tera/pulls/971","id":81633272,"html_url":"https://github.com/baidu/tera/pull/971","diff_url":"https://github.com/baidu/tera/pull/971.diff","patch_url":"https://github.com/baidu/tera/pull/971.patch","issue_url":"https://api.github.com/repos/baidu/tera/issues/971","number":971,"state":"open","locked":false,"title":"增加RowMutation 使用手册#964","user":{"login":"xupeilin","id":11419707,"avatar_url":"https://avatars.githubusercontent.com/u/11419707?v=3","gravatar_id":"","url":"https://api.github.com/users/xupeilin","html_url":"https://github.com/xupeilin","followers_url":"https://api.github.com/users/xupeilin/followers","following_url":"https://api.github.com/users/xupeilin/following{/other_user}","gists_url":"https://api.github.com/users/xupeilin/gists{/gist_id}","starred_url":"https://api.github.com/users/xupeilin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xupeilin/subscriptions","organizations_url":"https://api.github.com/users/xupeilin/orgs","repos_url":"https://api.github.com/users/xupeilin/repos","events_url":"https://api.github.com/users/xupeilin/events{/privacy}","received_events_url":"https://api.github.com/users/xupeilin/received_events","type":"User","site_admin":false},"body":"#964","created_at":"2016-08-17T12:26:15Z","updated_at":"2016-08-19T04:58:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3840f3e38e6c7bc8a906c8f5bcdce70e1cf76088","assignee":{"login":"00k","id":9716419,"avatar_url":"https://avatars.githubusercontent.com/u/9716419?v=3","gravatar_id":"","url":"https://api.github.com/users/00k","html_url":"https://github.com/00k","followers_url":"https://api.github.com/users/00k/followers","following_url":"https://api.github.com/users/00k/following{/other_user}","gists_url":"https://api.github.com/users/00k/gists{/gist_id}","starred_url":"https://api.github.com/users/00k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/00k/subscriptions","organizations_url":"https://api.github.com/users/00k/orgs","repos_url":"https://api.github.com/users/00k/repos","events_url":"https://api.github.com/users/00k/events{/privacy}","received_events_url":"https://api.github.com/users/00k/received_events","type":"User","site_admin":false},"assignees":[{"login":"00k","id":9716419,"avatar_url":"https://avatars.githubusercontent.com/u/9716419?v=3","gravatar_id":"","url":"https://api.github.com/users/00k","html_url":"https://github.com/00k","followers_url":"https://api.github.com/users/00k/followers","following_url":"https://api.github.com/users/00k/following{/other_user}","gists_url":"https://api.github.com/users/00k/gists{/gist_id}","starred_url":"https://api.github.com/users/00k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/00k/subscriptions","organizations_url":"https://api.github.com/users/00k/orgs","repos_url":"https://api.github.com/users/00k/repos","events_url":"https://api.github.com/users/00k/events{/privacy}","received_events_url":"https://api.github.com/users/00k/received_events","type":"User","site_admin":false},{"login":"caijieming-baidu","id":13461134,"avatar_url":"https://avatars.githubusercontent.com/u/13461134?v=3","gravatar_id":"","url":"https://api.github.com/users/caijieming-baidu","html_url":"https://github.com/caijieming-baidu","followers_url":"https://api.github.com/users/caijieming-baidu/followers","following_url":"https://api.github.com/users/caijieming-baidu/following{/other_user}","gists_url":"https://api.github.com/users/caijieming-baidu/gists{/gist_id}","starred_url":"https://api.github.com/users/caijieming-baidu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caijieming-baidu/subscriptions","organizations_url":"https://api.github.com/users/caijieming-baidu/orgs","repos_url":"https://api.github.com/users/caijieming-baidu/repos","events_url":"https://api.github.com/users/caijieming-baidu/events{/privacy}","received_events_url":"https://api.github.com/users/caijieming-baidu/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/baidu/tera/pulls/971/commits","review_comments_url":"https://api.github.com/repos/baidu/tera/pulls/971/comments","review_comment_url":"https://api.github.com/repos/baidu/tera/pulls/comments{/number}","comments_url":"https://api.github.com/repos/baidu/tera/issues/971/comments","statuses_url":"https://api.github.com/repos/baidu/tera/statuses/31fea970888437a7e52ab475831df834ea86d09c","head":{"label":"xupeilin:sdk_reference","ref":"sdk_reference","sha":"31fea970888437a7e52ab475831df834ea86d09c","user":{"login":"xupeilin","id":11419707,"avatar_url":"https://avatars.githubusercontent.com/u/11419707?v=3","gravatar_id":"","url":"https://api.github.com/users/xupeilin","html_url":"https://github.com/xupeilin","followers_url":"https://api.github.com/users/xupeilin/followers","following_url":"https://api.github.com/users/xupeilin/following{/other_user}","gists_url":"https://api.github.com/users/xupeilin/gists{/gist_id}","starred_url":"https://api.github.com/users/xupeilin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xupeilin/subscriptions","organizations_url":"https://api.github.com/users/xupeilin/orgs","repos_url":"https://api.github.com/users/xupeilin/repos","events_url":"https://api.github.com/users/xupeilin/events{/privacy}","received_events_url":"https://api.github.com/users/xupeilin/received_events","type":"User","site_admin":false},"repo":{"id":32515161,"name":"tera","full_name":"xupeilin/tera","owner":{"login":"xupeilin","id":11419707,"avatar_url":"https://avatars.githubusercontent.com/u/11419707?v=3","gravatar_id":"","url":"https://api.github.com/users/xupeilin","html_url":"https://github.com/xupeilin","followers_url":"https://api.github.com/users/xupeilin/followers","following_url":"https://api.github.com/users/xupeilin/following{/other_user}","gists_url":"https://api.github.com/users/xupeilin/gists{/gist_id}","starred_url":"https://api.github.com/users/xupeilin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xupeilin/subscriptions","organizations_url":"https://api.github.com/users/xupeilin/orgs","repos_url":"https://api.github.com/users/xupeilin/repos","events_url":"https://api.github.com/users/xupeilin/events{/privacy}","received_events_url":"https://api.github.com/users/xupeilin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xupeilin/tera","description":"A distributed table storage system.","fork":true,"url":"https://api.github.com/repos/xupeilin/tera","forks_url":"https://api.github.com/repos/xupeilin/tera/forks","keys_url":"https://api.github.com/repos/xupeilin/tera/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xupeilin/tera/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xupeilin/tera/teams","hooks_url":"https://api.github.com/repos/xupeilin/tera/hooks","issue_events_url":"https://api.github.com/repos/xupeilin/tera/issues/events{/number}","events_url":"https://api.github.com/repos/xupeilin/tera/events","assignees_url":"https://api.github.com/repos/xupeilin/tera/assignees{/user}","branches_url":"https://api.github.com/repos/xupeilin/tera/branches{/branch}","tags_url":"https://api.github.com/repos/xupeilin/tera/tags","blobs_url":"https://api.github.com/repos/xupeilin/tera/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xupeilin/tera/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xupeilin/tera/git/refs{/sha}","trees_url":"https://api.github.com/repos/xupeilin/tera/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xupeilin/tera/statuses/{sha}","languages_url":"https://api.github.com/repos/xupeilin/tera/languages","stargazers_url":"https://api.github.com/repos/xupeilin/tera/stargazers","contributors_url":"https://api.github.com/repos/xupeilin/tera/contributors","subscribers_url":"https://api.github.com/repos/xupeilin/tera/subscribers","subscription_url":"https://api.github.com/repos/xupeilin/tera/subscription","commits_url":"https://api.github.com/repos/xupeilin/tera/commits{/sha}","git_commits_url":"https://api.github.com/repos/xupeilin/tera/git/commits{/sha}","comments_url":"https://api.github.com/repos/xupeilin/tera/comments{/number}","issue_comment_url":"https://api.github.com/repos/xupeilin/tera/issues/comments{/number}","contents_url":"https://api.github.com/repos/xupeilin/tera/contents/{+path}","compare_url":"https://api.github.com/repos/xupeilin/tera/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xupeilin/tera/merges","archive_url":"https://api.github.com/repos/xupeilin/tera/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xupeilin/tera/downloads","issues_url":"https://api.github.com/repos/xupeilin/tera/issues{/number}","pulls_url":"https://api.github.com/repos/xupeilin/tera/pulls{/number}","milestones_url":"https://api.github.com/repos/xupeilin/tera/milestones{/number}","notifications_url":"https://api.github.com/repos/xupeilin/tera/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xupeilin/tera/labels{/name}","releases_url":"https://api.github.com/repos/xupeilin/tera/releases{/id}","deployments_url":"https://api.github.com/repos/xupeilin/tera/deployments","created_at":"2015-03-19T10:32:01Z","updated_at":"2016-03-17T06:48:11Z","pushed_at":"2016-08-18T13:23:51Z","git_url":"git://github.com/xupeilin/tera.git","ssh_url":"git@github.com:xupeilin/tera.git","clone_url":"https://github.com/xupeilin/tera.git","svn_url":"https://github.com/xupeilin/tera","homepage":"","size":15861,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"baidu:master","ref":"master","sha":"55ea4ceaa19deb35d6a838dd0784f9897f098cc7","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}","deployments_url":"https://api.github.com/repos/baidu/tera/deployments","created_at":"2014-03-26T07:22:05Z","updated_at":"2016-08-14T12:28:25Z","pushed_at":"2016-08-18T13:39:49Z","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":17557,"stargazers_count":409,"watchers_count":409,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":149,"mirror_url":null,"open_issues_count":157,"forks":149,"open_issues":157,"watchers":409,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/baidu/tera/pulls/971"},"html":{"href":"https://github.com/baidu/tera/pull/971"},"issue":{"href":"https://api.github.com/repos/baidu/tera/issues/971"},"comments":{"href":"https://api.github.com/repos/baidu/tera/issues/971/comments"},"review_comments":{"href":"https://api.github.com/repos/baidu/tera/pulls/971/comments"},"review_comment":{"href":"https://api.github.com/repos/baidu/tera/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/baidu/tera/pulls/971/commits"},"statuses":{"href":"https://api.github.com/repos/baidu/tera/statuses/31fea970888437a7e52ab475831df834ea86d09c"}}}}
{"actor":{"display_login":"00k"}}