martinzink commented on code in PR #1926:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1926#discussion_r2000997537
##########
libminifi/src/core/flow/StructuredConfiguration.cpp:
##########
@@ -580,13 +579,12 @@ void
StructuredConfiguration::parseProvenanceReporting(const Node& node, core::P
throw std::invalid_argument("Invalid scheduling strategy " +
schedulingStrategyStr);
}
- int64_t lvalue = 0;
if (node["host"] && node["port"]) {
auto hostStr = node["host"].getString().value();
std::string portStr = node["port"].getIntegerAsString().value();
- if (core::Property::StringToInt(portStr, lvalue) && !hostStr.empty()) {
- logger_->log_debug("ProvenanceReportingTask port {}", lvalue);
+ if (auto port = parsing::parseIntegral<int64_t>(portStr)) {
+ logger_->log_debug("ProvenanceReportingTask port {}", *port);
std::string url = hostStr + ":" + portStr;
reportTask->setURL(url);
}
Review Comment:
good catch,
https://github.com/apache/nifi-minifi-cpp/pull/1926/commits/446da68da32fa0b1f2a08d068d527fe065981d97
##########
libminifi/src/core/flow/StructuredConfiguration.cpp:
##########
@@ -753,27 +751,25 @@ void StructuredConfiguration::parseRPGPort(const Node&
port_node, core::ProcessG
processor.setScheduledState(core::RUNNING);
if (auto tasksNode = port_node[schema_.max_concurrent_tasks]) {
- std::string rawMaxConcurrentTasks = tasksNode.getIntegerAsString().value();
- int32_t maxConcurrentTasks = 0;
- if (core::Property::StringToInt(rawMaxConcurrentTasks,
maxConcurrentTasks)) {
- processor.setMaxConcurrentTasks(maxConcurrentTasks);
+ const std::string raw_max_concurrent_tasks =
tasksNode.getIntegerAsString().value();
+ if (auto max_concurrent_tasks =
parsing::parseIntegral<uint8_t>(raw_max_concurrent_tasks).value_or(0)) {
+ logger_->log_debug("parseProcessorNode: maxConcurrentTasks => [{}]",
max_concurrent_tasks);
+ processor.setMaxConcurrentTasks(max_concurrent_tasks);
}
Review Comment:
good idea,
https://github.com/apache/nifi-minifi-cpp/pull/1926/commits/446da68da32fa0b1f2a08d068d527fe065981d97
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]