{"action":"created","comment":{"url":"https://api.github.com/repos/apache/bookkeeper/pulls/comments/265946522","pull_request_review_id":214988600,"id":265946522,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2NTk0NjUyMg==","diff_hunk":"@@ -0,0 +1,130 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  You may obtain a copy of the License at\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+package org.apache.bookkeeper.tools.cli.commands.bookie;\n+\n+import com.beust.jcommander.Parameter;\n+import com.google.common.util.concurrent.UncheckedExecutionException;\n+import lombok.Setter;\n+import lombok.experimental.Accessors;\n+import org.apache.bookkeeper.bookie.Bookie;\n+import org.apache.bookkeeper.bookie.InterleavedLedgerStorage;\n+import org.apache.bookkeeper.bookie.LedgerCache;\n+import org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage;\n+import org.apache.bookkeeper.conf.ServerConfiguration;\n+import org.apache.bookkeeper.tools.cli.helpers.BookieCommand;\n+import org.apache.bookkeeper.tools.framework.CliFlags;\n+import org.apache.bookkeeper.tools.framework.CliSpec;\n+import org.apache.bookkeeper.util.LedgerIdFormatter;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+/**\n+ * A command to convert bookie indexes from InterleavedStorage to DbLedgerStorage format.\n+ */\n+public class ConvertToDBStorageCommand extends BookieCommand<ConvertToDBStorageCommand.CTDBFlags> {\n+\n+    private static final Logger LOG = LoggerFactory.getLogger(ConvertToDBStorageCommand.class);\n+    private static final String NAME = \"converttodbstorage\";\n+    private static final String DESC = \"Convert bookie indexes from InterleavedStorage to DbLedgerStorage format\";\n+\n+    @Setter\n+    private LedgerIdFormatter ledgerIdFormatter;\n+\n+    public ConvertToDBStorageCommand() {\n+        this(new CTDBFlags());\n+    }\n+    public ConvertToDBStorageCommand(CTDBFlags flags) {\n+        super(CliSpec.<CTDBFlags>newBuilder().withFlags(flags).withName(NAME).withDescription(DESC).build());\n+    }\n+\n+    /**\n+     * Flags for this command.\n+     */\n+    @Accessors(fluent = true)\n+    @Setter\n+    public static class CTDBFlags extends CliFlags {\n+\n+        @Parameter(names = { \"-l\", \"--ledgeridformatter\" }, description = \"Set ledger id formatter\")\n+        private String ledgerIdFormatter = \"\";","path":"bookkeeper-server/src/main/java/org/apache/bookkeeper/tools/cli/commands/bookie/ConvertToDBStorageCommand.java","position":null,"original_position":64,"commit_id":"1db0f293b6dca32f402dca78bfc2041112dfc859","original_commit_id":"5d17c37852fa5133a170b0decc3394b18299772e","user":{"login":"zymap","id":24502569,"node_id":"MDQ6VXNlcjI0NTAyNTY5","avatar_url":"https://avatars3.githubusercontent.com/u/24502569?v=4","gravatar_id":"","url":"https://api.github.com/users/zymap","html_url":"https://github.com/zymap","followers_url":"https://api.github.com/users/zymap/followers","following_url":"https://api.github.com/users/zymap/following{/other_user}","gists_url":"https://api.github.com/users/zymap/gists{/gist_id}","starred_url":"https://api.github.com/users/zymap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zymap/subscriptions","organizations_url":"https://api.github.com/users/zymap/orgs","repos_url":"https://api.github.com/users/zymap/repos","events_url":"https://api.github.com/users/zymap/events{/privacy}","received_events_url":"https://api.github.com/users/zymap/received_events","type":"User","site_admin":false},"body":"Sure, have fixed","created_at":"2019-03-15T11:39:26Z","updated_at":"2019-03-15T11:39:26Z","html_url":"https://github.com/apache/bookkeeper/pull/1986#discussion_r265946522","pull_request_url":"https://api.github.com/repos/apache/bookkeeper/pulls/1986","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/bookkeeper/pulls/comments/265946522"},"html":{"href":"https://github.com/apache/bookkeeper/pull/1986#discussion_r265946522"},"pull_request":{"href":"https://api.github.com/repos/apache/bookkeeper/pulls/1986"}},"in_reply_to_id":265919426},"pull_request":{"url":"https://api.github.com/repos/apache/bookkeeper/pulls/1986","id":261458604,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYxNDU4NjA0","html_url":"https://github.com/apache/bookkeeper/pull/1986","diff_url":"https://github.com/apache/bookkeeper/pull/1986.diff","patch_url":"https://github.com/apache/bookkeeper/pull/1986.patch","issue_url":"https://api.github.com/repos/apache/bookkeeper/issues/1986","number":1986,"state":"open","locked":false,"title":"Issue #1985: Migrate command `convert-to-db-storage`","user":{"login":"zymap","id":24502569,"node_id":"MDQ6VXNlcjI0NTAyNTY5","avatar_url":"https://avatars3.githubusercontent.com/u/24502569?v=4","gravatar_id":"","url":"https://api.github.com/users/zymap","html_url":"https://github.com/zymap","followers_url":"https://api.github.com/users/zymap/followers","following_url":"https://api.github.com/users/zymap/following{/other_user}","gists_url":"https://api.github.com/users/zymap/gists{/gist_id}","starred_url":"https://api.github.com/users/zymap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zymap/subscriptions","organizations_url":"https://api.github.com/users/zymap/orgs","repos_url":"https://api.github.com/users/zymap/repos","events_url":"https://api.github.com/users/zymap/events{/privacy}","received_events_url":"https://api.github.com/users/zymap/received_events","type":"User","site_admin":false},"body":"*Motivation*\r\n\r\n- Use bkctl to run command `convert-to-db-storage`\r\n\r\n*Modifications*\r\n\r\n- Add command in `bookieGroup`\r\n","created_at":"2019-03-15T08:16:38Z","updated_at":"2019-03-15T11:39:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"445956ce377464606eb788c3e6a29866bbc4095e","assignee":{"login":"zymap","id":24502569,"node_id":"MDQ6VXNlcjI0NTAyNTY5","avatar_url":"https://avatars3.githubusercontent.com/u/24502569?v=4","gravatar_id":"","url":"https://api.github.com/users/zymap","html_url":"https://github.com/zymap","followers_url":"https://api.github.com/users/zymap/followers","following_url":"https://api.github.com/users/zymap/following{/other_user}","gists_url":"https://api.github.com/users/zymap/gists{/gist_id}","starred_url":"https://api.github.com/users/zymap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zymap/subscriptions","organizations_url":"https://api.github.com/users/zymap/orgs","repos_url":"https://api.github.com/users/zymap/repos","events_url":"https://api.github.com/users/zymap/events{/privacy}","received_events_url":"https://api.github.com/users/zymap/received_events","type":"User","site_admin":false},"assignees":[{"login":"zymap","id":24502569,"node_id":"MDQ6VXNlcjI0NTAyNTY5","avatar_url":"https://avatars3.githubusercontent.com/u/24502569?v=4","gravatar_id":"","url":"https://api.github.com/users/zymap","html_url":"https://github.com/zymap","followers_url":"https://api.github.com/users/zymap/followers","following_url":"https://api.github.com/users/zymap/following{/other_user}","gists_url":"https://api.github.com/users/zymap/gists{/gist_id}","starred_url":"https://api.github.com/users/zymap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zymap/subscriptions","organizations_url":"https://api.github.com/users/zymap/orgs","repos_url":"https://api.github.com/users/zymap/repos","events_url":"https://api.github.com/users/zymap/events{/privacy}","received_events_url":"https://api.github.com/users/zymap/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"sijie","id":1217863,"node_id":"MDQ6VXNlcjEyMTc4NjM=","avatar_url":"https://avatars2.githubusercontent.com/u/1217863?v=4","gravatar_id":"","url":"https://api.github.com/users/sijie","html_url":"https://github.com/sijie","followers_url":"https://api.github.com/users/sijie/followers","following_url":"https://api.github.com/users/sijie/following{/other_user}","gists_url":"https://api.github.com/users/sijie/gists{/gist_id}","starred_url":"https://api.github.com/users/sijie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sijie/subscriptions","organizations_url":"https://api.github.com/users/sijie/orgs","repos_url":"https://api.github.com/users/sijie/repos","events_url":"https://api.github.com/users/sijie/events{/privacy}","received_events_url":"https://api.github.com/users/sijie/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/bookkeeper/pulls/1986/commits","review_comments_url":"https://api.github.com/repos/apache/bookkeeper/pulls/1986/comments","review_comment_url":"https://api.github.com/repos/apache/bookkeeper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/bookkeeper/issues/1986/comments","statuses_url":"https://api.github.com/repos/apache/bookkeeper/statuses/1db0f293b6dca32f402dca78bfc2041112dfc859","head":{"label":"zymap:command-ctdb","ref":"command-ctdb","sha":"1db0f293b6dca32f402dca78bfc2041112dfc859","user":{"login":"zymap","id":24502569,"node_id":"MDQ6VXNlcjI0NTAyNTY5","avatar_url":"https://avatars3.githubusercontent.com/u/24502569?v=4","gravatar_id":"","url":"https://api.github.com/users/zymap","html_url":"https://github.com/zymap","followers_url":"https://api.github.com/users/zymap/followers","following_url":"https://api.github.com/users/zymap/following{/other_user}","gists_url":"https://api.github.com/users/zymap/gists{/gist_id}","starred_url":"https://api.github.com/users/zymap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zymap/subscriptions","organizations_url":"https://api.github.com/users/zymap/orgs","repos_url":"https://api.github.com/users/zymap/repos","events_url":"https://api.github.com/users/zymap/events{/privacy}","received_events_url":"https://api.github.com/users/zymap/received_events","type":"User","site_admin":false},"repo":{"id":172659503,"node_id":"MDEwOlJlcG9zaXRvcnkxNzI2NTk1MDM=","name":"bookkeeper","full_name":"zymap/bookkeeper","private":false,"owner":{"login":"zymap","id":24502569,"node_id":"MDQ6VXNlcjI0NTAyNTY5","avatar_url":"https://avatars3.githubusercontent.com/u/24502569?v=4","gravatar_id":"","url":"https://api.github.com/users/zymap","html_url":"https://github.com/zymap","followers_url":"https://api.github.com/users/zymap/followers","following_url":"https://api.github.com/users/zymap/following{/other_user}","gists_url":"https://api.github.com/users/zymap/gists{/gist_id}","starred_url":"https://api.github.com/users/zymap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zymap/subscriptions","organizations_url":"https://api.github.com/users/zymap/orgs","repos_url":"https://api.github.com/users/zymap/repos","events_url":"https://api.github.com/users/zymap/events{/privacy}","received_events_url":"https://api.github.com/users/zymap/received_events","type":"User","site_admin":false},"html_url":"https://github.com/zymap/bookkeeper","description":"Apache Bookkeeper","fork":true,"url":"https://api.github.com/repos/zymap/bookkeeper","forks_url":"https://api.github.com/repos/zymap/bookkeeper/forks","keys_url":"https://api.github.com/repos/zymap/bookkeeper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zymap/bookkeeper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zymap/bookkeeper/teams","hooks_url":"https://api.github.com/repos/zymap/bookkeeper/hooks","issue_events_url":"https://api.github.com/repos/zymap/bookkeeper/issues/events{/number}","events_url":"https://api.github.com/repos/zymap/bookkeeper/events","assignees_url":"https://api.github.com/repos/zymap/bookkeeper/assignees{/user}","branches_url":"https://api.github.com/repos/zymap/bookkeeper/branches{/branch}","tags_url":"https://api.github.com/repos/zymap/bookkeeper/tags","blobs_url":"https://api.github.com/repos/zymap/bookkeeper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zymap/bookkeeper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zymap/bookkeeper/git/refs{/sha}","trees_url":"https://api.github.com/repos/zymap/bookkeeper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zymap/bookkeeper/statuses/{sha}","languages_url":"https://api.github.com/repos/zymap/bookkeeper/languages","stargazers_url":"https://api.github.com/repos/zymap/bookkeeper/stargazers","contributors_url":"https://api.github.com/repos/zymap/bookkeeper/contributors","subscribers_url":"https://api.github.com/repos/zymap/bookkeeper/subscribers","subscription_url":"https://api.github.com/repos/zymap/bookkeeper/subscription","commits_url":"https://api.github.com/repos/zymap/bookkeeper/commits{/sha}","git_commits_url":"https://api.github.com/repos/zymap/bookkeeper/git/commits{/sha}","comments_url":"https://api.github.com/repos/zymap/bookkeeper/comments{/number}","issue_comment_url":"https://api.github.com/repos/zymap/bookkeeper/issues/comments{/number}","contents_url":"https://api.github.com/repos/zymap/bookkeeper/contents/{+path}","compare_url":"https://api.github.com/repos/zymap/bookkeeper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zymap/bookkeeper/merges","archive_url":"https://api.github.com/repos/zymap/bookkeeper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zymap/bookkeeper/downloads","issues_url":"https://api.github.com/repos/zymap/bookkeeper/issues{/number}","pulls_url":"https://api.github.com/repos/zymap/bookkeeper/pulls{/number}","milestones_url":"https://api.github.com/repos/zymap/bookkeeper/milestones{/number}","notifications_url":"https://api.github.com/repos/zymap/bookkeeper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zymap/bookkeeper/labels{/name}","releases_url":"https://api.github.com/repos/zymap/bookkeeper/releases{/id}","deployments_url":"https://api.github.com/repos/zymap/bookkeeper/deployments","created_at":"2019-02-26T07:24:59Z","updated_at":"2019-03-03T08:58:34Z","pushed_at":"2019-03-15T11:37:23Z","git_url":"git://github.com/zymap/bookkeeper.git","ssh_url":"git@github.com:zymap/bookkeeper.git","clone_url":"https://github.com/zymap/bookkeeper.git","svn_url":"https://github.com/zymap/bookkeeper","homepage":"https://bookkeeper.apache.org","size":43109,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"fa90f0185c51e8f842148945e4958cbc02cbe023","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":1575956,"node_id":"MDEwOlJlcG9zaXRvcnkxNTc1OTU2","name":"bookkeeper","full_name":"apache/bookkeeper","private":false,"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},"html_url":"https://github.com/apache/bookkeeper","description":"Apache Bookkeeper","fork":false,"url":"https://api.github.com/repos/apache/bookkeeper","forks_url":"https://api.github.com/repos/apache/bookkeeper/forks","keys_url":"https://api.github.com/repos/apache/bookkeeper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/bookkeeper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/bookkeeper/teams","hooks_url":"https://api.github.com/repos/apache/bookkeeper/hooks","issue_events_url":"https://api.github.com/repos/apache/bookkeeper/issues/events{/number}","events_url":"https://api.github.com/repos/apache/bookkeeper/events","assignees_url":"https://api.github.com/repos/apache/bookkeeper/assignees{/user}","branches_url":"https://api.github.com/repos/apache/bookkeeper/branches{/branch}","tags_url":"https://api.github.com/repos/apache/bookkeeper/tags","blobs_url":"https://api.github.com/repos/apache/bookkeeper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/bookkeeper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/bookkeeper/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/bookkeeper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/bookkeeper/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/bookkeeper/languages","stargazers_url":"https://api.github.com/repos/apache/bookkeeper/stargazers","contributors_url":"https://api.github.com/repos/apache/bookkeeper/contributors","subscribers_url":"https://api.github.com/repos/apache/bookkeeper/subscribers","subscription_url":"https://api.github.com/repos/apache/bookkeeper/subscription","commits_url":"https://api.github.com/repos/apache/bookkeeper/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/bookkeeper/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/bookkeeper/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/bookkeeper/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/bookkeeper/contents/{+path}","compare_url":"https://api.github.com/repos/apache/bookkeeper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/bookkeeper/merges","archive_url":"https://api.github.com/repos/apache/bookkeeper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/bookkeeper/downloads","issues_url":"https://api.github.com/repos/apache/bookkeeper/issues{/number}","pulls_url":"https://api.github.com/repos/apache/bookkeeper/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/bookkeeper/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/bookkeeper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/bookkeeper/labels{/name}","releases_url":"https://api.github.com/repos/apache/bookkeeper/releases{/id}","deployments_url":"https://api.github.com/repos/apache/bookkeeper/deployments","created_at":"2011-04-06T07:00:07Z","updated_at":"2019-03-15T06:56:48Z","pushed_at":"2019-03-15T11:37:25Z","git_url":"git://github.com/apache/bookkeeper.git","ssh_url":"git@github.com:apache/bookkeeper.git","clone_url":"https://github.com/apache/bookkeeper.git","svn_url":"https://github.com/apache/bookkeeper","homepage":"https://bookkeeper.apache.org","size":42828,"stargazers_count":607,"watchers_count":607,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":244,"mirror_url":null,"archived":false,"open_issues_count":196,"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":244,"open_issues":196,"watchers":607,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/bookkeeper/pulls/1986"},"html":{"href":"https://github.com/apache/bookkeeper/pull/1986"},"issue":{"href":"https://api.github.com/repos/apache/bookkeeper/issues/1986"},"comments":{"href":"https://api.github.com/repos/apache/bookkeeper/issues/1986/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/bookkeeper/pulls/1986/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/bookkeeper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/bookkeeper/pulls/1986/commits"},"statuses":{"href":"https://api.github.com/repos/apache/bookkeeper/statuses/1db0f293b6dca32f402dca78bfc2041112dfc859"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zymap"}}