Yifan Zhang has posted comments on this change. ( http://gerrit.cloudera.org:8080/18330 )
Change subject: [tool] Fix pbc dump instance for -json/ -json_pretty ...................................................................... Patch Set 4: (4 comments) You fix this by reading json string, converting json string to json object, editing json object, and converting it to a new json string... I think maybe we can fix it in a better way? http://gerrit.cloudera.org:8080/#/c/18330/4/src/kudu/tools/kudu-tool-test.cc File src/kudu/tools/kudu-tool-test.cc: http://gerrit.cloudera.org:8080/#/c/18330/4/src/kudu/tools/kudu-tool-test.cc@1598 PS4, Line 1598: nit: remove these blanks. http://gerrit.cloudera.org:8080/#/c/18330/4/src/kudu/tools/tool_action_pbc.cc File src/kudu/tools/tool_action_pbc.cc: http://gerrit.cloudera.org:8080/#/c/18330/4/src/kudu/tools/tool_action_pbc.cc@210 PS4, Line 210: RETURN_NOT_OK(pb_reader.Dump(&stream, format, true)); I think we can add a new flag '--decode_uuid' for this tool, and re-edit the json string after dumping protobuf message, instead of doing this in 'ReadablePBContainerFile::Dump()'. http://gerrit.cloudera.org:8080/#/c/18330/4/src/kudu/util/easy_json.cc File src/kudu/util/easy_json.cc: http://gerrit.cloudera.org:8080/#/c/18330/4/src/kudu/util/easy_json.cc@41 PS4, Line 41: // alloc_ is not used nit: maybe remove this comment? http://gerrit.cloudera.org:8080/#/c/18330/4/src/kudu/util/pb_util.cc File src/kudu/util/pb_util.cc: http://gerrit.cloudera.org:8080/#/c/18330/4/src/kudu/util/pb_util.cc@1033 PS4, Line 1033: if (format == Format::JSON_PRETTY) { : *os << new_json.ToString(true) << endl; : } else { : *os << new_json.ToString(false) << endl; : } nit: maybe convert it to 'new_json.ToString(format)' -- To view, visit http://gerrit.cloudera.org:8080/18330 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia21afb03d9b7b4b2d4ea5aaa642701451282bebf Gerrit-Change-Number: 18330 Gerrit-PatchSet: 4 Gerrit-Owner: Yuqi Du <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Yifan Zhang <[email protected]> Gerrit-Comment-Date: Tue, 29 Mar 2022 13:27:58 +0000 Gerrit-HasComments: Yes
