Adar Dembo has posted comments on this change. Change subject: tool: add a 'pbc edit' command ......................................................................
Patch Set 1: (4 comments) http://gerrit.cloudera.org:8080/#/c/7048/1/src/kudu/tools/tool_action_pbc.cc File src/kudu/tools/tool_action_pbc.cc: PS1, Line 142: "pbc-edit.XXXXXX" > If we name it "pbc-edit.XXXXXX.json" then vim / emacs will give us syntax h We should also include the standard Kudu tmpdir infix so that if you leave one behind in a data directory it'll get cleaned up. Line 173: for (const string& l : lines) { > one per line can be hard to edit for larger messages. Would it be difficult Agreed. How does protobuf write out the JSON-encoded messages? I presume it's a top-level JSON array of messages, so perhaps we could parse with rapidjson, iterate over the top-level array, serialize each record _back_ to JSON, then hand that off to JsonStringToMessage()? It's excessive, but it should allow for more flexibility in the editing process. Line 194: WARN_NOT_OK(env->SyncDir(dir), "couldn't sync directory"); If you're going to sync the directory you should also sync pb_writer before you close it. http://gerrit.cloudera.org:8080/#/c/7048/1/src/kudu/util/pb_util-test.cc File src/kudu/util/pb_util-test.cc: Line 557: const char* kExpectedOutputJson = Is this expected output stable? Can we ensure that it's stable by asking the protobuf JSON parser thing to sort the keys or something? -- To view, visit http://gerrit.cloudera.org:8080/7048 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9434935469df8978a4f3fb3719f0245499aece5 Gerrit-PatchSet: 1 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Todd Lipcon <t...@apache.org> Gerrit-Reviewer: Adar Dembo <a...@cloudera.com> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <mpe...@apache.org> Gerrit-Reviewer: Tidy Bot Gerrit-Reviewer: Todd Lipcon <t...@apache.org> Gerrit-HasComments: Yes