{"action":"created","comment":{"url":"https://api.github.com/repos/baidu/tera/pulls/comments/63304111","id":63304111,"diff_hunk":"@@ -0,0 +1,72 @@\n+// Copyright (c) 2016, Baidu.com, Inc. All Rights Reserved\n+// Use of this source code is governed by a BSD-style license that can be\n+// found in the LICENSE file.\n+\n+#ifndef  TERA_SDK_ROW_TXN_IMPL_H_\n+#define  TERA_SDK_ROW_TXN_IMPL_H_\n+\n+#include <string>\n+\n+#include \"sdk/mutate_impl.h\"\n+#include \"sdk/tera.h\"\n+\n+namespace common {\n+class ThreadPool;\n+}\n+\n+namespace tera {\n+\n+class TableImpl;\n+\n+class RowTransactionImpl : public Transaction {\n+    friend void ReadCallbackWrapper(RowReader* row_reader);\n+    friend void MutateCallbackWrapper(RowMutation* row_mu);\n+public:\n+    RowTransactionImpl(TableImpl* table, const std::string& row_key,\n+                       common::ThreadPool* thread_pool);\n+    virtual ~RowTransactionImpl();\n+\n+    /// 提交一个修改操作\n+    virtual void ApplyMutation(RowMutation* row_mu);\n+    /// 读取操作\n+    virtual void Get(RowReader* row_reader);\n+\n+    /// 设置提交回调, 提交操作会异步返回\n+    virtual void SetCommitCallback(Callback callback);\n+    /// 获取提交回调\n+    virtual Callback GetCommitCallback();\n+    /// 设置回滚回调, 回滚操作会异步返回\n+    virtual void SetRollbackCallback(Callback callback);\n+    /// 获取回滚回调\n+    virtual Callback GetRollbackCallback();\n+\n+    /// 设置用户上下文，可在回调函数中获取\n+    virtual void SetContext(void* context);\n+    /// 获取用户上下文\n+    virtual void* GetContext();\n+\n+    /// 获得结果错误码\n+    virtual const ErrorCode& GetError();\n+\n+public:\n+    /// 提交事务\n+    virtual void Commit();\n+    /// 回滚事务\n+    virtual void Rollback();\n+\n+private:\n+    TableImpl* _table;\n+    const std::string _row_key;\n+    Callback _commit_callback;\n+    Callback _rollback_callback;\n+    void* _user_context;\n+    common::ThreadPool* _thread_pool;\n+\n+    RowMutationImpl _mutation_buffer;\n+    RowReader::Callback _user_reader_callback;\n+    void* _user_reader_context;\n+};","path":"src/sdk/row_txn_impl.h","position":68,"original_position":68,"commit_id":"d525ebffa87de4564ae1c8549d1b1cb9be3f0b9c","original_commit_id":"d525ebffa87de4564ae1c8549d1b1cb9be3f0b9c","user":{"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},"body":"没有行的最大版本号字段？","created_at":"2016-05-16T02:13:22Z","updated_at":"2016-05-16T02:13:22Z","html_url":"https://github.com/baidu/tera/pull/884#discussion_r63304111","pull_request_url":"https://api.github.com/repos/baidu/tera/pulls/884","_links":{"self":{"href":"https://api.github.com/repos/baidu/tera/pulls/comments/63304111"},"html":{"href":"https://github.com/baidu/tera/pull/884#discussion_r63304111"},"pull_request":{"href":"https://api.github.com/repos/baidu/tera/pulls/884"}}},"pull_request":{"url":"https://api.github.com/repos/baidu/tera/pulls/884","id":69993420,"html_url":"https://github.com/baidu/tera/pull/884","diff_url":"https://github.com/baidu/tera/pull/884.diff","patch_url":"https://github.com/baidu/tera/pull/884.patch","issue_url":"https://api.github.com/repos/baidu/tera/issues/884","number":884,"state":"open","locked":false,"title":"ISSUE=#877 row txn api and basic dataflow","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":"#877  分成下面四次PR，本次是1\r\n1. API和读写数据流\r\n2. TS支持row max sequence\r\n3. row max sequence和数据流结合\r\n4. 支持临时快照（待定）","created_at":"2016-05-13T13:12:36Z","updated_at":"2016-05-16T02:13:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6f701d313604c01361877f692653e6e0409dec0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/baidu/tera/pulls/884/commits","review_comments_url":"https://api.github.com/repos/baidu/tera/pulls/884/comments","review_comment_url":"https://api.github.com/repos/baidu/tera/pulls/comments{/number}","comments_url":"https://api.github.com/repos/baidu/tera/issues/884/comments","statuses_url":"https://api.github.com/repos/baidu/tera/statuses/d525ebffa87de4564ae1c8549d1b1cb9be3f0b9c","head":{"label":"00k:row_txn_for_pr","ref":"row_txn_for_pr","sha":"d525ebffa87de4564ae1c8549d1b1cb9be3f0b9c","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},"repo":{"id":32000292,"name":"tera","full_name":"00k/tera","owner":{"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},"private":false,"html_url":"https://github.com/00k/tera","description":"A distributed table storage system.","fork":true,"url":"https://api.github.com/repos/00k/tera","forks_url":"https://api.github.com/repos/00k/tera/forks","keys_url":"https://api.github.com/repos/00k/tera/keys{/key_id}","collaborators_url":"https://api.github.com/repos/00k/tera/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/00k/tera/teams","hooks_url":"https://api.github.com/repos/00k/tera/hooks","issue_events_url":"https://api.github.com/repos/00k/tera/issues/events{/number}","events_url":"https://api.github.com/repos/00k/tera/events","assignees_url":"https://api.github.com/repos/00k/tera/assignees{/user}","branches_url":"https://api.github.com/repos/00k/tera/branches{/branch}","tags_url":"https://api.github.com/repos/00k/tera/tags","blobs_url":"https://api.github.com/repos/00k/tera/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/00k/tera/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/00k/tera/git/refs{/sha}","trees_url":"https://api.github.com/repos/00k/tera/git/trees{/sha}","statuses_url":"https://api.github.com/repos/00k/tera/statuses/{sha}","languages_url":"https://api.github.com/repos/00k/tera/languages","stargazers_url":"https://api.github.com/repos/00k/tera/stargazers","contributors_url":"https://api.github.com/repos/00k/tera/contributors","subscribers_url":"https://api.github.com/repos/00k/tera/subscribers","subscription_url":"https://api.github.com/repos/00k/tera/subscription","commits_url":"https://api.github.com/repos/00k/tera/commits{/sha}","git_commits_url":"https://api.github.com/repos/00k/tera/git/commits{/sha}","comments_url":"https://api.github.com/repos/00k/tera/comments{/number}","issue_comment_url":"https://api.github.com/repos/00k/tera/issues/comments{/number}","contents_url":"https://api.github.com/repos/00k/tera/contents/{+path}","compare_url":"https://api.github.com/repos/00k/tera/compare/{base}...{head}","merges_url":"https://api.github.com/repos/00k/tera/merges","archive_url":"https://api.github.com/repos/00k/tera/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/00k/tera/downloads","issues_url":"https://api.github.com/repos/00k/tera/issues{/number}","pulls_url":"https://api.github.com/repos/00k/tera/pulls{/number}","milestones_url":"https://api.github.com/repos/00k/tera/milestones{/number}","notifications_url":"https://api.github.com/repos/00k/tera/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/00k/tera/labels{/name}","releases_url":"https://api.github.com/repos/00k/tera/releases{/id}","deployments_url":"https://api.github.com/repos/00k/tera/deployments","created_at":"2015-03-11T05:36:34Z","updated_at":"2016-01-11T03:35:16Z","pushed_at":"2016-05-13T13:06:19Z","git_url":"git://github.com/00k/tera.git","ssh_url":"git@github.com:00k/tera.git","clone_url":"https://github.com/00k/tera.git","svn_url":"https://github.com/00k/tera","homepage":"","size":13357,"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":"8cf5b2c12c0069519a50003c80fb076472ae563f","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-05-15T13:10:33Z","pushed_at":"2016-05-13T13:12:36Z","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":16842,"stargazers_count":386,"watchers_count":386,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":135,"mirror_url":null,"open_issues_count":168,"forks":135,"open_issues":168,"watchers":386,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/baidu/tera/pulls/884"},"html":{"href":"https://github.com/baidu/tera/pull/884"},"issue":{"href":"https://api.github.com/repos/baidu/tera/issues/884"},"comments":{"href":"https://api.github.com/repos/baidu/tera/issues/884/comments"},"review_comments":{"href":"https://api.github.com/repos/baidu/tera/pulls/884/comments"},"review_comment":{"href":"https://api.github.com/repos/baidu/tera/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/baidu/tera/pulls/884/commits"},"statuses":{"href":"https://api.github.com/repos/baidu/tera/statuses/d525ebffa87de4564ae1c8549d1b1cb9be3f0b9c"}}}}