{"action":"created","comment":{"url":"https://api.github.com/repos/baidu/tera/pulls/comments/41692500","id":41692500,"diff_hunk":"@@ -25,36 +25,22 @@ const char* KvCompactStrategy::Name() const {\n \n bool KvCompactStrategy::Drop(const leveldb::Slice& tera_key, uint64_t n,\n                              const std::string& lower_bound) {\n-    // If expire timestamp + schema's TTL <= time(NULL), Then Drop.\n-    // Desc: 当前TTL的语义理解为：假设用户指定了key在03:10分过期，\n-    // 同时Schema的TTL为+300(延后5分钟), 那么这个key将在03:15分过期.\n-    //\n-    // 这种语义下, 如果希望一个key提前过期, 只需要修改schema让TTL为负值\n-    // 例如-300(提前5分钟), 那么这个key将在03:05分过期.\n-    //\n-    // 不过, 对于用户曾经插入的永不过期的key, 无论怎么调整schema的TTL都不会产生任何作用。\n-\n     leveldb::Slice row_key;\n     int64_t expire_timestamp;\n     raw_key_operator_->ExtractTeraKey(tera_key, &row_key, NULL, NULL,\n             &expire_timestamp, NULL);\n \n     int64_t now = get_micros() / 1000000;\n-\n-    int64_t final_expire_timestamp = expire_timestamp\n-            + schema_.column_families(0).time_to_live();\n-    if (final_expire_timestamp <= 0 /*上溢,永不过期*/\n-    || final_expire_timestamp > now) {\n+    if (expire_timestamp <= 0 /*上溢,永不过期*/\n+    || expire_timestamp > now) {","path":"src/io/ttlkv_compact_strategy.cc","position":25,"original_position":25,"commit_id":"c5ed944a639a81a784f99178c006c230fe2aace2","original_commit_id":"c5ed944a639a81a784f99178c006c230fe2aace2","user":{"login":"bluebore","id":6851389,"avatar_url":"https://avatars.githubusercontent.com/u/6851389?v=3","gravatar_id":"","url":"https://api.github.com/users/bluebore","html_url":"https://github.com/bluebore","followers_url":"https://api.github.com/users/bluebore/followers","following_url":"https://api.github.com/users/bluebore/following{/other_user}","gists_url":"https://api.github.com/users/bluebore/gists{/gist_id}","starred_url":"https://api.github.com/users/bluebore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluebore/subscriptions","organizations_url":"https://api.github.com/users/bluebore/orgs","repos_url":"https://api.github.com/users/bluebore/repos","events_url":"https://api.github.com/users/bluebore/events{/privacy}","received_events_url":"https://api.github.com/users/bluebore/received_events","type":"User","site_admin":false},"body":"缩进有问题","created_at":"2015-10-10T03:26:18Z","updated_at":"2015-10-10T03:26:18Z","html_url":"https://github.com/baidu/tera/pull/366#discussion_r41692500","pull_request_url":"https://api.github.com/repos/baidu/tera/pulls/366","_links":{"self":{"href":"https://api.github.com/repos/baidu/tera/pulls/comments/41692500"},"html":{"href":"https://github.com/baidu/tera/pull/366#discussion_r41692500"},"pull_request":{"href":"https://api.github.com/repos/baidu/tera/pulls/366"}}},"pull_request":{"url":"https://api.github.com/repos/baidu/tera/pulls/366","id":46373755,"html_url":"https://github.com/baidu/tera/pull/366","diff_url":"https://github.com/baidu/tera/pull/366.diff","patch_url":"https://github.com/baidu/tera/pull/366.patch","issue_url":"https://api.github.com/repos/baidu/tera/issues/366","number":366,"state":"open","locked":false,"title":"abrogate table-ttl in ttlkv #365","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":"#365","created_at":"2015-09-30T08:30:05Z","updated_at":"2015-10-10T03:26:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68ca45f926d9ce6fce81d9369b1eb425a95f805d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/baidu/tera/pulls/366/commits","review_comments_url":"https://api.github.com/repos/baidu/tera/pulls/366/comments","review_comment_url":"https://api.github.com/repos/baidu/tera/pulls/comments{/number}","comments_url":"https://api.github.com/repos/baidu/tera/issues/366/comments","statuses_url":"https://api.github.com/repos/baidu/tera/statuses/c5ed944a639a81a784f99178c006c230fe2aace2","head":{"label":"xupeilin:bug/ttlkv-drop-core","ref":"bug/ttlkv-drop-core","sha":"c5ed944a639a81a784f99178c006c230fe2aace2","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}","created_at":"2015-03-19T10:32:01Z","updated_at":"2015-05-07T13:57:33Z","pushed_at":"2015-09-30T08:29:44Z","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":14608,"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":"e8f23f6ea04ec4a5f9f846fb55a2e0cd315b6525","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":"2015-09-29T07:06:59Z","pushed_at":"2015-10-10T03:22:38Z","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":15766,"stargazers_count":288,"watchers_count":288,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":91,"mirror_url":null,"open_issues_count":40,"forks":91,"open_issues":40,"watchers":288,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/baidu/tera/pulls/366"},"html":{"href":"https://github.com/baidu/tera/pull/366"},"issue":{"href":"https://api.github.com/repos/baidu/tera/issues/366"},"comments":{"href":"https://api.github.com/repos/baidu/tera/issues/366/comments"},"review_comments":{"href":"https://api.github.com/repos/baidu/tera/pulls/366/comments"},"review_comment":{"href":"https://api.github.com/repos/baidu/tera/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/baidu/tera/pulls/366/commits"},"statuses":{"href":"https://api.github.com/repos/baidu/tera/statuses/c5ed944a639a81a784f99178c006c230fe2aace2"}}}}