Yingchun Lai has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/17808 )

Change subject: [tool] Support to dump and edit pbc in JSON pretty format
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/17808/1/src/kudu/tools/tool_action_pbc.cc
File src/kudu/tools/tool_action_pbc.cc:

http://gerrit.cloudera.org:8080/#/c/17808/1/src/kudu/tools/tool_action_pbc.cc@216
PS1, Line 216:     char read_buffer[65536];
             :     rapidjson::FileReadStream in_stream(fp, read_buffer, 
sizeof(read_buffer));
             :
             :     JsonParseOptions opts;
             :     opts.case_insensitive_enum_parsing = true;
             :     do {
             :       // The file may contains multiple JSON objects, parse one 
object once.
             :       rapidjson::Document document;
             :       
document.ParseStream<rapidjson::kParseStopWhenDoneFlag>(in_stream);
             :       if (document.HasParseError()) {
             :         auto code = document.GetParseError();
             :         if (code != rapidjson::kParseErrorDocumentEmpty) {
             :           return Status::Corruption("JSON text is corrupt",
             :                                     
rapidjson::GetParseError_En(code));
             :         }
             :         // No more JSON object left.
             :         break;
             :       }
             :
             :       // Convert one JSON object to protobuf object once.
             :       rapidjson::StringBuffer buffer;
             :       rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
             :       document.Accept(writer);
             :       m->Clear();
             :       auto str = buffer.GetString();
             :       const auto& google_status = JsonStringToMessage(str, 
m.get(), opts);
             :       if (!google_status.ok()) {
             :         return Status::InvalidArgument(
             :             Substitute("Unable to parse JSON text: $0", str),
             :             google_status.error_message().ToString());
             :       }
             :
             :       // Append the protobuf object to writer.
             :
> Seems like when we were printing compact json, Kudu emitted one message on
Andrew is right.
Comments added.



--
To view, visit http://gerrit.cloudera.org:8080/17808
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6d404e6cd487a644fa848513670c4945bf789578
Gerrit-Change-Number: 17808
Gerrit-PatchSet: 2
Gerrit-Owner: Yingchun Lai <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Bankim Bhavsar <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Yingchun Lai <[email protected]>
Gerrit-Comment-Date: Thu, 26 Aug 2021 10:30:14 +0000
Gerrit-HasComments: Yes

Reply via email to