[
https://issues.apache.org/jira/browse/MINIFICPP-114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16256162#comment-16256162
]
ASF GitHub Bot commented on MINIFICPP-114:
------------------------------------------
Github user phrocker commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/191#discussion_r151568175
--- Diff: extensions/http-curl/sitetosite/PeersEntity.h ---
@@ -35,73 +41,82 @@ class PeersEntity {
public:
static bool parse(const std::shared_ptr<logging::Logger> &logger, const
std::string &entity, uuid_t id, std::vector<PeerStatus> &peer_statuses) {
-
- Json::Reader reader;
- Json::Value root;
try {
- if (reader.parse(entity, root)) {
- if (root.isMember("peers") && root["peers"].size() > 0) {
- for (const auto &peer : root["peers"]) {
+ rapidjson::Document root;
+ rapidjson::ParseResult ok = root.Parse(entity.c_str());
- std::string hostname;
- int port = 0, flowFileCount = 0;
- bool secure = false;
+ if (!ok) {
+ std::stringstream ss;
+ ss << "Failed to parse archive lens stack from JSON string with
reason: "
+ << rapidjson::GetParseError_En(ok.Code())
+ << " at offset " << ok.Offset();
+ std::string exception_msg = ss.str();
+
+ throw Exception(ExceptionType::GENERAL_EXCEPTION,
exception_msg.c_str());
--- End diff --
Thanks for doing this. I was noticing this a few days ago.
> Consolidate JSON API use to RapidJSON
> -------------------------------------
>
> Key: MINIFICPP-114
> URL: https://issues.apache.org/jira/browse/MINIFICPP-114
> Project: NiFi MiNiFi C++
> Issue Type: Improvement
> Reporter: John Reynolds
> Assignee: John Reynolds
>
> MiNiFi was updated with new dependencies to jsoncpp:
> SiteToSiteProvenanceReportingTask
> Performance observations indicate significant improvements with RapidJSON vs.
> jsoncpp. Convert all use of jsoncpp to RapidJSON where applicable.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)