You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "lordgamez (via GitHub)" <gi...@apache.org> on 2025/03/05 11:34:38 UTC
[PR] MINIFICPP-2530 Fix various issue and cleanup OPC processors [nifi-minifi-cpp]
lordgamez opened a new pull request, #1940:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1940
- Namespace index is now also taken account when using `Path` node id type instead of using the default 0 namespace
- Added `Path reference types` property to OPC processors to specify reference types between nodes if `Path` node id type is specified, if not specified `Organized` reference type is used by default
- `Create node reference type` property is added to `PutOPCProcessor` to specify reference type if a new node is created, if not specified then `HasComponent` reference type is used by default (previously `Organized` was used in all cases)
- `Trusted server certificate path` property can now take multiple certificates as a comma-separated value
- Fixed `Full path` attribute output in `FetchOPCProcessor` (missing '/' character between base path and node browse name)
- `TargetNodeID` and `TargetNodeIDType` are now required in `PutOPCProcessor`, no default target node is created if no target node properties are specified
- Thirdparty OPC UA library is upgraded to version 1.4.10
- OPC source files are cleaned up and refactored
- Added integration tests for putting and fetching OPC nodes using `Path` node id type
https://issues.apache.org/jira/browse/MINIFICPP-2530
---------------------
Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
- [ ] Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
- [ ] Has your PR been rebased against the latest commit within the target branch (typically main)?
- [ ] Is your initial contribution a single, squashed commit?
### For code changes:
- [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the LICENSE file?
- [ ] If applicable, have you updated the NOTICE file?
### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
### Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINIFICPP-2530 Fix various issues and cleanup OPC processors [nifi-minifi-cpp]
Posted by "martinzink (via GitHub)" <gi...@apache.org>.
martinzink closed pull request #1940: MINIFICPP-2530 Fix various issues and cleanup OPC processors
URL: https://github.com/apache/nifi-minifi-cpp/pull/1940
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINIFICPP-2530 Fix various issues and cleanup OPC processors [nifi-minifi-cpp]
Posted by "fgerlits (via GitHub)" <gi...@apache.org>.
fgerlits commented on code in PR #1940:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1940#discussion_r2028977279
##########
extensions/opc/src/opc.cpp:
##########
@@ -325,72 +332,80 @@ void Client::traverse(UA_NodeId nodeId, const std::function<nodeFoundCallBackFun
}
}
-bool Client::exists(UA_NodeId nodeId) {
+bool Client::exists(UA_NodeId node_id) {
bool retval = false;
- auto callback = [&retval](Client& /*client*/, const UA_ReferenceDescription* /*ref*/, const std::string& /*pat*/) -> bool {
+ auto callback = [&retval](const UA_ReferenceDescription* /*ref*/, const std::string& /*pat*/) -> bool {
retval = true;
return false; // If any node is found, the given node exists, so traverse can be stopped
};
- traverse(nodeId, callback, "", 1);
+ traverse(node_id, callback, "", 1);
return retval;
}
-UA_StatusCode Client::translateBrowsePathsToNodeIdsRequest(const std::string& path, std::vector<UA_NodeId>& foundNodeIDs, const std::shared_ptr<core::logging::Logger>& logger) {
- logger->log_trace("Trying to find node id for {}", path.c_str());
+UA_StatusCode Client::translateBrowsePathsToNodeIdsRequest(const std::string& path, std::vector<UA_NodeId>& found_node_ids, int32_t namespace_index,
+ const std::vector<UA_UInt32>& path_reference_types, const std::shared_ptr<core::logging::Logger>& logger) {
+ logger->log_trace("Trying to find node ids for {}", path.c_str());
- auto tokens = utils::string::split(path, "/");
- std::vector<UA_UInt32> ids;
- for (size_t i = 0; i < tokens.size(); ++i) {
- UA_UInt32 val = (i ==0) ? UA_NS0ID_ORGANIZES : UA_NS0ID_HASCOMPONENT;
- ids.push_back(val);
- }
+ auto tokens = utils::string::splitAndTrimRemovingEmpty(path, "/");
- UA_BrowsePath browsePath;
- UA_BrowsePath_init(&browsePath);
- browsePath.startingNode = UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER);
+ UA_BrowsePath browse_path;
+ UA_BrowsePath_init(&browse_path);
+ browse_path.startingNode = UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER);
- browsePath.relativePath.elements = reinterpret_cast<UA_RelativePathElement*>(UA_Array_new(tokens.size(), &UA_TYPES[UA_TYPES_RELATIVEPATHELEMENT]));
- browsePath.relativePath.elementsSize = tokens.size();
+ browse_path.relativePath.elements = reinterpret_cast<UA_RelativePathElement*>(UA_Array_new(tokens.size(), &UA_TYPES[UA_TYPES_RELATIVEPATHELEMENT]));
+ browse_path.relativePath.elementsSize = tokens.size();
+
+ std::vector<UA_UInt32> ids;
+ ids.push_back(UA_NS0ID_ORGANIZES);
+ for (size_t i = 0; i < tokens.size() - 1; ++i) {
Review Comment:
I know we check this in `onSchedule`, but a `gsl_Expects(!tokens.empty())` before this line would make it look safe as well as being safe.
##########
extensions/opc/src/opcbase.cpp:
##########
@@ -24,85 +24,121 @@
#include "core/Processor.h"
#include "core/ProcessSession.h"
#include "core/Core.h"
+#include "utils/ProcessorConfigUtils.h"
namespace org::apache::nifi::minifi::processors {
- void BaseOPCProcessor::onSchedule(core::ProcessContext& context, core::ProcessSessionFactory&) {
- logger_->log_trace("BaseOPCProcessor::onSchedule");
+void BaseOPCProcessor::onSchedule(core::ProcessContext& context, core::ProcessSessionFactory&) {
+ logger_->log_trace("BaseOPCProcessor::onSchedule");
- applicationURI_.clear();
- certBuffer_.clear();
- keyBuffer_.clear();
- password_.clear();
- username_.clear();
- trustBuffers_.clear();
+ application_uri_.clear();
+ cert_buffer_.clear();
+ key_buffer_.clear();
+ password_.clear();
+ username_.clear();
+ trust_buffers_.clear();
- context.getProperty(OPCServerEndPoint, endPointURL_);
- context.getProperty(ApplicationURI, applicationURI_);
+ context.getProperty(OPCServerEndPoint, endpoint_url);
+ context.getProperty(ApplicationURI, application_uri_);
+ context.getProperty(Username, username_);
+ context.getProperty(Password, password_);
- if (context.getProperty(Username, username_) != context.getProperty(Password, password_)) {
- throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Both or neither of Username and Password should be provided!");
- }
+ if (username_.empty() != password_.empty()) {
+ throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Both or neither of Username and Password should be provided!");
+ }
- auto certificatePathRes = context.getProperty(CertificatePath, certpath_);
- auto keyPathRes = context.getProperty(KeyPath, keypath_);
- context.getProperty(TrustedPath, trustpath_);
- if (certificatePathRes != keyPathRes) {
- throw Exception(PROCESS_SCHEDULE_EXCEPTION, "All or none of Certificate path and Key path should be provided!");
- }
+ context.getProperty(CertificatePath, certpath_);
+ context.getProperty(KeyPath, keypath_);
+ context.getProperty(TrustedPath, trustpath_);
+ if (certpath_.empty() != keypath_.empty()) {
+ throw Exception(PROCESS_SCHEDULE_EXCEPTION, "All or none of Certificate path and Key path should be provided!");
+ }
- if (certpath_.empty()) {
- return;
- }
- if (applicationURI_.empty()) {
- throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Application URI must be provided if Certificate path is provided!");
- }
+ if (certpath_.empty()) {
+ return;
+ }
+ if (application_uri_.empty()) {
+ throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Application URI must be provided if Certificate path is provided!");
+ }
- std::ifstream input_cert(certpath_, std::ios::binary);
- if (input_cert.good()) {
- certBuffer_ = std::vector<char>(std::istreambuf_iterator<char>(input_cert), {});
- }
- std::ifstream input_key(keypath_, std::ios::binary);
- if (input_key.good()) {
- keyBuffer_ = std::vector<char>(std::istreambuf_iterator<char>(input_key), {});
- }
+ std::ifstream input_cert(certpath_, std::ios::binary);
+ if (input_cert.good()) {
+ cert_buffer_ = std::vector<char>(std::istreambuf_iterator<char>(input_cert), {});
+ }
+ std::ifstream input_key(keypath_, std::ios::binary);
+ if (input_key.good()) {
+ key_buffer_ = std::vector<char>(std::istreambuf_iterator<char>(input_key), {});
+ }
- if (certBuffer_.empty()) {
- auto error_msg = utils::string::join_pack("Failed to load cert from path: ", certpath_);
- throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
- }
- if (keyBuffer_.empty()) {
- auto error_msg = utils::string::join_pack("Failed to load key from path: ", keypath_);
+ if (cert_buffer_.empty()) {
+ auto error_msg = utils::string::join_pack("Failed to load cert from path: ", certpath_);
+ throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
+ }
+ if (key_buffer_.empty()) {
+ auto error_msg = utils::string::join_pack("Failed to load key from path: ", keypath_);
+ throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
+ }
+
+ auto trusted_cert_paths = utils::string::splitAndTrimRemovingEmpty(trustpath_, ",");
+ for (const auto& trust_path : trusted_cert_paths) {
+ std::ifstream input_trust(trust_path, std::ios::binary);
+ if (input_trust.good()) {
+ trust_buffers_.push_back(std::vector<char>(std::istreambuf_iterator<char>(input_trust), {}));
+ } else {
+ auto error_msg = utils::string::join_pack("Failed to load trusted server certs from path: ", trust_path);
throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
}
+ }
+}
- if (!trustpath_.empty()) {
- std::ifstream input_trust(trustpath_, std::ios::binary);
- if (input_trust.good()) {
- trustBuffers_.push_back(std::vector<char>(std::istreambuf_iterator<char>(input_trust), {}));
- } else {
- auto error_msg = utils::string::join_pack("Failed to load trusted server certs from path: ", trustpath_);
- throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
- }
- }
+bool BaseOPCProcessor::reconnect() {
+ if (connection_ == nullptr) {
+ connection_ = opc::Client::createClient(logger_, application_uri_, cert_buffer_, key_buffer_, trust_buffers_);
}
- bool BaseOPCProcessor::reconnect() {
- if (connection_ == nullptr) {
- connection_ = opc::Client::createClient(logger_, applicationURI_, certBuffer_, keyBuffer_, trustBuffers_);
- }
+ if (connection_->isConnected()) {
+ return true;
+ }
- if (connection_->isConnected()) {
- return true;
+ auto sc = connection_->connect(endpoint_url, username_, password_);
+ if (sc != UA_STATUSCODE_GOOD) {
+ logger_->log_error("Failed to connect: {}!", UA_StatusCode_name(sc));
+ return false;
+ }
+ logger_->log_debug("Successfully connected.");
+ return true;
+}
+
+void BaseOPCProcessor::readPathReferenceTypes(core::ProcessContext& context, const std::string& node_id) {
+ std::string value;
+ context.getProperty(PathReferenceTypes, value);
+ if (value.empty()) {
+ return;
+ }
+ auto path_reference_types = utils::string::splitAndTrimRemovingEmpty(value, "/");
+ if (path_reference_types.size() != utils::string::splitAndTrimRemovingEmpty(node_id, "/").size() - 1) {
Review Comment:
I may be overly paranoid about subtracting from unsigned numbers, but I'd prefer `if (path_reference_types.size() + 1 != utils::string::splitAndTrimRemovingEmpty(node_id, "/").size())`
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINIFICPP-2530 Fix various issues and cleanup OPC processors [nifi-minifi-cpp]
Posted by "lordgamez (via GitHub)" <gi...@apache.org>.
lordgamez commented on code in PR #1940:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1940#discussion_r2030844003
##########
extensions/opc/src/opc.cpp:
##########
@@ -325,72 +332,80 @@ void Client::traverse(UA_NodeId nodeId, const std::function<nodeFoundCallBackFun
}
}
-bool Client::exists(UA_NodeId nodeId) {
+bool Client::exists(UA_NodeId node_id) {
bool retval = false;
- auto callback = [&retval](Client& /*client*/, const UA_ReferenceDescription* /*ref*/, const std::string& /*pat*/) -> bool {
+ auto callback = [&retval](const UA_ReferenceDescription* /*ref*/, const std::string& /*pat*/) -> bool {
retval = true;
return false; // If any node is found, the given node exists, so traverse can be stopped
};
- traverse(nodeId, callback, "", 1);
+ traverse(node_id, callback, "", 1);
return retval;
}
-UA_StatusCode Client::translateBrowsePathsToNodeIdsRequest(const std::string& path, std::vector<UA_NodeId>& foundNodeIDs, const std::shared_ptr<core::logging::Logger>& logger) {
- logger->log_trace("Trying to find node id for {}", path.c_str());
+UA_StatusCode Client::translateBrowsePathsToNodeIdsRequest(const std::string& path, std::vector<UA_NodeId>& found_node_ids, int32_t namespace_index,
+ const std::vector<UA_UInt32>& path_reference_types, const std::shared_ptr<core::logging::Logger>& logger) {
+ logger->log_trace("Trying to find node ids for {}", path.c_str());
- auto tokens = utils::string::split(path, "/");
- std::vector<UA_UInt32> ids;
- for (size_t i = 0; i < tokens.size(); ++i) {
- UA_UInt32 val = (i ==0) ? UA_NS0ID_ORGANIZES : UA_NS0ID_HASCOMPONENT;
- ids.push_back(val);
- }
+ auto tokens = utils::string::splitAndTrimRemovingEmpty(path, "/");
- UA_BrowsePath browsePath;
- UA_BrowsePath_init(&browsePath);
- browsePath.startingNode = UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER);
+ UA_BrowsePath browse_path;
+ UA_BrowsePath_init(&browse_path);
+ browse_path.startingNode = UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER);
- browsePath.relativePath.elements = reinterpret_cast<UA_RelativePathElement*>(UA_Array_new(tokens.size(), &UA_TYPES[UA_TYPES_RELATIVEPATHELEMENT]));
- browsePath.relativePath.elementsSize = tokens.size();
+ browse_path.relativePath.elements = reinterpret_cast<UA_RelativePathElement*>(UA_Array_new(tokens.size(), &UA_TYPES[UA_TYPES_RELATIVEPATHELEMENT]));
+ browse_path.relativePath.elementsSize = tokens.size();
+
+ std::vector<UA_UInt32> ids;
+ ids.push_back(UA_NS0ID_ORGANIZES);
+ for (size_t i = 0; i < tokens.size() - 1; ++i) {
Review Comment:
Updated in https://github.com/apache/nifi-minifi-cpp/pull/1940/commits/b78b3a0087955b6e804b78054041fcf16281e96b
##########
extensions/opc/src/opcbase.cpp:
##########
@@ -24,85 +24,121 @@
#include "core/Processor.h"
#include "core/ProcessSession.h"
#include "core/Core.h"
+#include "utils/ProcessorConfigUtils.h"
namespace org::apache::nifi::minifi::processors {
- void BaseOPCProcessor::onSchedule(core::ProcessContext& context, core::ProcessSessionFactory&) {
- logger_->log_trace("BaseOPCProcessor::onSchedule");
+void BaseOPCProcessor::onSchedule(core::ProcessContext& context, core::ProcessSessionFactory&) {
+ logger_->log_trace("BaseOPCProcessor::onSchedule");
- applicationURI_.clear();
- certBuffer_.clear();
- keyBuffer_.clear();
- password_.clear();
- username_.clear();
- trustBuffers_.clear();
+ application_uri_.clear();
+ cert_buffer_.clear();
+ key_buffer_.clear();
+ password_.clear();
+ username_.clear();
+ trust_buffers_.clear();
- context.getProperty(OPCServerEndPoint, endPointURL_);
- context.getProperty(ApplicationURI, applicationURI_);
+ context.getProperty(OPCServerEndPoint, endpoint_url);
+ context.getProperty(ApplicationURI, application_uri_);
+ context.getProperty(Username, username_);
+ context.getProperty(Password, password_);
- if (context.getProperty(Username, username_) != context.getProperty(Password, password_)) {
- throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Both or neither of Username and Password should be provided!");
- }
+ if (username_.empty() != password_.empty()) {
+ throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Both or neither of Username and Password should be provided!");
+ }
- auto certificatePathRes = context.getProperty(CertificatePath, certpath_);
- auto keyPathRes = context.getProperty(KeyPath, keypath_);
- context.getProperty(TrustedPath, trustpath_);
- if (certificatePathRes != keyPathRes) {
- throw Exception(PROCESS_SCHEDULE_EXCEPTION, "All or none of Certificate path and Key path should be provided!");
- }
+ context.getProperty(CertificatePath, certpath_);
+ context.getProperty(KeyPath, keypath_);
+ context.getProperty(TrustedPath, trustpath_);
+ if (certpath_.empty() != keypath_.empty()) {
+ throw Exception(PROCESS_SCHEDULE_EXCEPTION, "All or none of Certificate path and Key path should be provided!");
+ }
- if (certpath_.empty()) {
- return;
- }
- if (applicationURI_.empty()) {
- throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Application URI must be provided if Certificate path is provided!");
- }
+ if (certpath_.empty()) {
+ return;
+ }
+ if (application_uri_.empty()) {
+ throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Application URI must be provided if Certificate path is provided!");
+ }
- std::ifstream input_cert(certpath_, std::ios::binary);
- if (input_cert.good()) {
- certBuffer_ = std::vector<char>(std::istreambuf_iterator<char>(input_cert), {});
- }
- std::ifstream input_key(keypath_, std::ios::binary);
- if (input_key.good()) {
- keyBuffer_ = std::vector<char>(std::istreambuf_iterator<char>(input_key), {});
- }
+ std::ifstream input_cert(certpath_, std::ios::binary);
+ if (input_cert.good()) {
+ cert_buffer_ = std::vector<char>(std::istreambuf_iterator<char>(input_cert), {});
+ }
+ std::ifstream input_key(keypath_, std::ios::binary);
+ if (input_key.good()) {
+ key_buffer_ = std::vector<char>(std::istreambuf_iterator<char>(input_key), {});
+ }
- if (certBuffer_.empty()) {
- auto error_msg = utils::string::join_pack("Failed to load cert from path: ", certpath_);
- throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
- }
- if (keyBuffer_.empty()) {
- auto error_msg = utils::string::join_pack("Failed to load key from path: ", keypath_);
+ if (cert_buffer_.empty()) {
+ auto error_msg = utils::string::join_pack("Failed to load cert from path: ", certpath_);
+ throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
+ }
+ if (key_buffer_.empty()) {
+ auto error_msg = utils::string::join_pack("Failed to load key from path: ", keypath_);
+ throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
+ }
+
+ auto trusted_cert_paths = utils::string::splitAndTrimRemovingEmpty(trustpath_, ",");
+ for (const auto& trust_path : trusted_cert_paths) {
+ std::ifstream input_trust(trust_path, std::ios::binary);
+ if (input_trust.good()) {
+ trust_buffers_.push_back(std::vector<char>(std::istreambuf_iterator<char>(input_trust), {}));
+ } else {
+ auto error_msg = utils::string::join_pack("Failed to load trusted server certs from path: ", trust_path);
throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
}
+ }
+}
- if (!trustpath_.empty()) {
- std::ifstream input_trust(trustpath_, std::ios::binary);
- if (input_trust.good()) {
- trustBuffers_.push_back(std::vector<char>(std::istreambuf_iterator<char>(input_trust), {}));
- } else {
- auto error_msg = utils::string::join_pack("Failed to load trusted server certs from path: ", trustpath_);
- throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
- }
- }
+bool BaseOPCProcessor::reconnect() {
+ if (connection_ == nullptr) {
+ connection_ = opc::Client::createClient(logger_, application_uri_, cert_buffer_, key_buffer_, trust_buffers_);
}
- bool BaseOPCProcessor::reconnect() {
- if (connection_ == nullptr) {
- connection_ = opc::Client::createClient(logger_, applicationURI_, certBuffer_, keyBuffer_, trustBuffers_);
- }
+ if (connection_->isConnected()) {
+ return true;
+ }
- if (connection_->isConnected()) {
- return true;
+ auto sc = connection_->connect(endpoint_url, username_, password_);
+ if (sc != UA_STATUSCODE_GOOD) {
+ logger_->log_error("Failed to connect: {}!", UA_StatusCode_name(sc));
+ return false;
+ }
+ logger_->log_debug("Successfully connected.");
+ return true;
+}
+
+void BaseOPCProcessor::readPathReferenceTypes(core::ProcessContext& context, const std::string& node_id) {
+ std::string value;
+ context.getProperty(PathReferenceTypes, value);
+ if (value.empty()) {
+ return;
+ }
+ auto path_reference_types = utils::string::splitAndTrimRemovingEmpty(value, "/");
+ if (path_reference_types.size() != utils::string::splitAndTrimRemovingEmpty(node_id, "/").size() - 1) {
Review Comment:
Updated in https://github.com/apache/nifi-minifi-cpp/pull/1940/commits/b78b3a0087955b6e804b78054041fcf16281e96b
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINIFICPP-2530 Fix various issues and cleanup OPC processors [nifi-minifi-cpp]
Posted by "martinzink (via GitHub)" <gi...@apache.org>.
martinzink commented on code in PR #1940:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1940#discussion_r2035259172
##########
extensions/opc/src/fetchopc.cpp:
##########
@@ -32,153 +32,136 @@
namespace org::apache::nifi::minifi::processors {
- void FetchOPCProcessor::initialize() {
- setSupportedProperties(Properties);
- setSupportedRelationships(Relationships);
- }
+void FetchOPCProcessor::initialize() {
+ setSupportedProperties(Properties);
+ setSupportedRelationships(Relationships);
+}
- void FetchOPCProcessor::onSchedule(core::ProcessContext& context, core::ProcessSessionFactory& factory) {
- logger_->log_trace("FetchOPCProcessor::onSchedule");
+void FetchOPCProcessor::onSchedule(core::ProcessContext& context, core::ProcessSessionFactory& factory) {
+ logger_->log_trace("FetchOPCProcessor::onSchedule");
- translatedNodeIDs_.clear(); // Path might has changed during restart
+ translated_node_ids_.clear(); // Path might has changed during restart
- BaseOPCProcessor::onSchedule(context, factory);
+ BaseOPCProcessor::onSchedule(context, factory);
- nodeID_ = context.getProperty(NodeID).value_or("");
- std::string value = context.getProperty(NodeIDType).value_or("");
+ node_id_ = context.getProperty(NodeID).value_or("");
Review Comment:
Since NodeID is required we can safely parse it like this
```suggestion
node_id_ = utils::parseProperty(context, NodeID);
```
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINIFICPP-2530 Fix various issues and cleanup OPC processors [nifi-minifi-cpp]
Posted by "lordgamez (via GitHub)" <gi...@apache.org>.
lordgamez commented on code in PR #1940:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1940#discussion_r2035302259
##########
extensions/opc/src/fetchopc.cpp:
##########
@@ -32,153 +32,136 @@
namespace org::apache::nifi::minifi::processors {
- void FetchOPCProcessor::initialize() {
- setSupportedProperties(Properties);
- setSupportedRelationships(Relationships);
- }
+void FetchOPCProcessor::initialize() {
+ setSupportedProperties(Properties);
+ setSupportedRelationships(Relationships);
+}
- void FetchOPCProcessor::onSchedule(core::ProcessContext& context, core::ProcessSessionFactory& factory) {
- logger_->log_trace("FetchOPCProcessor::onSchedule");
+void FetchOPCProcessor::onSchedule(core::ProcessContext& context, core::ProcessSessionFactory& factory) {
+ logger_->log_trace("FetchOPCProcessor::onSchedule");
- translatedNodeIDs_.clear(); // Path might has changed during restart
+ translated_node_ids_.clear(); // Path might has changed during restart
- BaseOPCProcessor::onSchedule(context, factory);
+ BaseOPCProcessor::onSchedule(context, factory);
- nodeID_ = context.getProperty(NodeID).value_or("");
- std::string value = context.getProperty(NodeIDType).value_or("");
+ node_id_ = context.getProperty(NodeID).value_or("");
Review Comment:
Updated in https://github.com/apache/nifi-minifi-cpp/pull/1940/commits/e417d8adfcb004daeaacefe0b1fe9b384505cf79
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org