{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-pulsar/pulls/comments/192133939","pull_request_review_id":124848962,"id":192133939,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjEzMzkzOQ==","diff_hunk":"@@ -614,6 +618,93 @@ void run() throws PulsarAdminException {\n         }\n     }\n \n+    static MessageId findFirstLedgerWithinThreshold(List<PersistentTopicInternalStats.LedgerInfo> ledgers,\n+                                                    long sizeThreshold) {\n+        long suffixSize = 0L;\n+\n+        ledgers = Lists.reverse(ledgers);\n+        for (PersistentTopicInternalStats.LedgerInfo l : ledgers) {\n+            suffixSize += l.size;\n+            if (suffixSize >= sizeThreshold) {\n+                return new MessageIdImpl(l.ledgerId, 0L, -1);\n+            }\n+        }\n+        return null;\n+    }\n+\n+    @Parameters(commandDescription = \"Trigger offload data from a topic to long term storage\")","path":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java","position":52,"original_position":52,"commit_id":"062aed48ba3c950454b66e98478a67d3fbccb858","original_commit_id":"062aed48ba3c950454b66e98478a67d3fbccb858","user":{"login":"ivankelly","id":54955,"node_id":"MDQ6VXNlcjU0OTU1","avatar_url":"https://avatars3.githubusercontent.com/u/54955?v=4","gravatar_id":"","url":"https://api.github.com/users/ivankelly","html_url":"https://github.com/ivankelly","followers_url":"https://api.github.com/users/ivankelly/followers","following_url":"https://api.github.com/users/ivankelly/following{/other_user}","gists_url":"https://api.github.com/users/ivankelly/gists{/gist_id}","starred_url":"https://api.github.com/users/ivankelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivankelly/subscriptions","organizations_url":"https://api.github.com/users/ivankelly/orgs","repos_url":"https://api.github.com/users/ivankelly/repos","events_url":"https://api.github.com/users/ivankelly/events{/privacy}","received_events_url":"https://api.github.com/users/ivankelly/received_events","type":"User","site_admin":false},"body":"done","created_at":"2018-05-31T15:10:55Z","updated_at":"2018-05-31T15:10:56Z","html_url":"https://github.com/apache/incubator-pulsar/pull/1865#discussion_r192133939","pull_request_url":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1865","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-pulsar/pulls/comments/192133939"},"html":{"href":"https://github.com/apache/incubator-pulsar/pull/1865#discussion_r192133939"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1865"}},"in_reply_to_id":191881259},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1865","id":191497574,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxNDk3NTc0","html_url":"https://github.com/apache/incubator-pulsar/pull/1865","diff_url":"https://github.com/apache/incubator-pulsar/pull/1865.diff","patch_url":"https://github.com/apache/incubator-pulsar/pull/1865.patch","issue_url":"https://api.github.com/repos/apache/incubator-pulsar/issues/1865","number":1865,"state":"open","locked":false,"title":"CLI for offload","user":{"login":"ivankelly","id":54955,"node_id":"MDQ6VXNlcjU0OTU1","avatar_url":"https://avatars3.githubusercontent.com/u/54955?v=4","gravatar_id":"","url":"https://api.github.com/users/ivankelly","html_url":"https://github.com/ivankelly","followers_url":"https://api.github.com/users/ivankelly/followers","following_url":"https://api.github.com/users/ivankelly/following{/other_user}","gists_url":"https://api.github.com/users/ivankelly/gists{/gist_id}","starred_url":"https://api.github.com/users/ivankelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivankelly/subscriptions","organizations_url":"https://api.github.com/users/ivankelly/orgs","repos_url":"https://api.github.com/users/ivankelly/repos","events_url":"https://api.github.com/users/ivankelly/events{/privacy}","received_events_url":"https://api.github.com/users/ivankelly/received_events","type":"User","site_admin":false},"body":"This patch adds two CLI commands for offload, one to trigger offload,\r\nand another to check offload status.\r\n\r\nTriggering offload requires a size-threshold argument, which is the\r\nmaximum number of bytes which should be retained locally. The prefix\r\nof ledgers over this threshold will be offloaded.\r\n\r\n```\r\npulsar-admin topics offload --size-threshold 104857600 persistent://public/default/topic1\r\npulsar-admin topics offload-status -w persistent://public/default/topic1\r\n```\r\n\r\nMaster Issue: #1511\r\n","created_at":"2018-05-30T15:41:23Z","updated_at":"2018-05-31T15:10:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef1cc7bead4cd961f8bfc1e73f7fd5a417edee0a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1865/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1865/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-pulsar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-pulsar/issues/1865/comments","statuses_url":"https://api.github.com/repos/apache/incubator-pulsar/statuses/062aed48ba3c950454b66e98478a67d3fbccb858","head":{"label":"ivankelly:tiered-cli","ref":"tiered-cli","sha":"062aed48ba3c950454b66e98478a67d3fbccb858","user":{"login":"ivankelly","id":54955,"node_id":"MDQ6VXNlcjU0OTU1","avatar_url":"https://avatars3.githubusercontent.com/u/54955?v=4","gravatar_id":"","url":"https://api.github.com/users/ivankelly","html_url":"https://github.com/ivankelly","followers_url":"https://api.github.com/users/ivankelly/followers","following_url":"https://api.github.com/users/ivankelly/following{/other_user}","gists_url":"https://api.github.com/users/ivankelly/gists{/gist_id}","starred_url":"https://api.github.com/users/ivankelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivankelly/subscriptions","organizations_url":"https://api.github.com/users/ivankelly/orgs","repos_url":"https://api.github.com/users/ivankelly/repos","events_url":"https://api.github.com/users/ivankelly/events{/privacy}","received_events_url":"https://api.github.com/users/ivankelly/received_events","type":"User","site_admin":false},"repo":{"id":110581105,"node_id":"MDEwOlJlcG9zaXRvcnkxMTA1ODExMDU=","name":"incubator-pulsar","full_name":"ivankelly/incubator-pulsar","owner":{"login":"ivankelly","id":54955,"node_id":"MDQ6VXNlcjU0OTU1","avatar_url":"https://avatars3.githubusercontent.com/u/54955?v=4","gravatar_id":"","url":"https://api.github.com/users/ivankelly","html_url":"https://github.com/ivankelly","followers_url":"https://api.github.com/users/ivankelly/followers","following_url":"https://api.github.com/users/ivankelly/following{/other_user}","gists_url":"https://api.github.com/users/ivankelly/gists{/gist_id}","starred_url":"https://api.github.com/users/ivankelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivankelly/subscriptions","organizations_url":"https://api.github.com/users/ivankelly/orgs","repos_url":"https://api.github.com/users/ivankelly/repos","events_url":"https://api.github.com/users/ivankelly/events{/privacy}","received_events_url":"https://api.github.com/users/ivankelly/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ivankelly/incubator-pulsar","description":"Pulsar - distributed pub-sub messaging system","fork":true,"url":"https://api.github.com/repos/ivankelly/incubator-pulsar","forks_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/forks","keys_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/teams","hooks_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/hooks","issue_events_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/issues/events{/number}","events_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/events","assignees_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/assignees{/user}","branches_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/branches{/branch}","tags_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/tags","blobs_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/git/refs{/sha}","trees_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/statuses/{sha}","languages_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/languages","stargazers_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/stargazers","contributors_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/contributors","subscribers_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/subscribers","subscription_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/subscription","commits_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/commits{/sha}","git_commits_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/git/commits{/sha}","comments_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/comments{/number}","issue_comment_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/issues/comments{/number}","contents_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/contents/{+path}","compare_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/merges","archive_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/downloads","issues_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/issues{/number}","pulls_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/pulls{/number}","milestones_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/milestones{/number}","notifications_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/labels{/name}","releases_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/releases{/id}","deployments_url":"https://api.github.com/repos/ivankelly/incubator-pulsar/deployments","created_at":"2017-11-13T17:46:25Z","updated_at":"2018-03-27T16:43:23Z","pushed_at":"2018-05-31T14:57:56Z","git_url":"git://github.com/ivankelly/incubator-pulsar.git","ssh_url":"git@github.com:ivankelly/incubator-pulsar.git","clone_url":"https://github.com/ivankelly/incubator-pulsar.git","svn_url":"https://github.com/ivankelly/incubator-pulsar","homepage":"https://pulsar.incubator.apache.org","size":25621,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"9b2653927c706e13310d19c18a66308935802386","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":62117812,"node_id":"MDEwOlJlcG9zaXRvcnk2MjExNzgxMg==","name":"incubator-pulsar","full_name":"apache/incubator-pulsar","owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-pulsar","description":"Pulsar - distributed pub-sub messaging system","fork":false,"url":"https://api.github.com/repos/apache/incubator-pulsar","forks_url":"https://api.github.com/repos/apache/incubator-pulsar/forks","keys_url":"https://api.github.com/repos/apache/incubator-pulsar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-pulsar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-pulsar/teams","hooks_url":"https://api.github.com/repos/apache/incubator-pulsar/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-pulsar/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-pulsar/events","assignees_url":"https://api.github.com/repos/apache/incubator-pulsar/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-pulsar/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-pulsar/tags","blobs_url":"https://api.github.com/repos/apache/incubator-pulsar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-pulsar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-pulsar/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-pulsar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-pulsar/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-pulsar/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-pulsar/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-pulsar/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-pulsar/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-pulsar/subscription","commits_url":"https://api.github.com/repos/apache/incubator-pulsar/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-pulsar/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-pulsar/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-pulsar/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-pulsar/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-pulsar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-pulsar/merges","archive_url":"https://api.github.com/repos/apache/incubator-pulsar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-pulsar/downloads","issues_url":"https://api.github.com/repos/apache/incubator-pulsar/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-pulsar/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-pulsar/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-pulsar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-pulsar/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-pulsar/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-pulsar/deployments","created_at":"2016-06-28T07:00:03Z","updated_at":"2018-05-31T06:57:14Z","pushed_at":"2018-05-31T14:58:26Z","git_url":"git://github.com/apache/incubator-pulsar.git","ssh_url":"git@github.com:apache/incubator-pulsar.git","clone_url":"https://github.com/apache/incubator-pulsar.git","svn_url":"https://github.com/apache/incubator-pulsar","homepage":"https://pulsar.incubator.apache.org","size":31729,"stargazers_count":1727,"watchers_count":1727,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":369,"mirror_url":null,"archived":false,"open_issues_count":169,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":369,"open_issues":169,"watchers":1727,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1865"},"html":{"href":"https://github.com/apache/incubator-pulsar/pull/1865"},"issue":{"href":"https://api.github.com/repos/apache/incubator-pulsar/issues/1865"},"comments":{"href":"https://api.github.com/repos/apache/incubator-pulsar/issues/1865/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1865/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-pulsar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-pulsar/pulls/1865/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-pulsar/statuses/062aed48ba3c950454b66e98478a67d3fbccb858"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ivankelly"}}