lordgamez commented on a change in pull request #1132:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1132#discussion_r681591721
##########
File path: libminifi/src/core/yaml/YamlConnectionParser.cpp
##########
@@ -29,24 +29,48 @@ namespace yaml {
// This is no longer needed in c++17
constexpr const char* YamlConnectionParser::CONFIG_YAML_CONNECTIONS_KEY;
+void YamlConnectionParser::addNewRelationshipToConnection(const std::string&
relationship_name, const std::shared_ptr<minifi::Connection>& connection) const
{
+ core::Relationship relationship(relationship_name, "");
+ logger_->log_debug("parseConnection: relationship => [%s]",
relationship_name);
+ connection->addRelationship(std::move(relationship));
+}
+
+void YamlConnectionParser::addFunnelRelationshipToConnection(const
std::shared_ptr<minifi::Connection>& connection) const {
+ utils::Identifier srcUUID;
+ try {
+ srcUUID = getSourceUUIDFromYaml();
+ } catch(const std::exception&) {
+ return;
Review comment:
I think there is no need, because `getSourceUUIDFromYaml` already logs
all the error cases.
##########
File path: libminifi/src/core/yaml/YamlConnectionParser.cpp
##########
@@ -29,24 +29,48 @@ namespace yaml {
// This is no longer needed in c++17
constexpr const char* YamlConnectionParser::CONFIG_YAML_CONNECTIONS_KEY;
+void YamlConnectionParser::addNewRelationshipToConnection(const std::string&
relationship_name, const std::shared_ptr<minifi::Connection>& connection) const
{
+ core::Relationship relationship(relationship_name, "");
+ logger_->log_debug("parseConnection: relationship => [%s]",
relationship_name);
+ connection->addRelationship(std::move(relationship));
+}
+
+void YamlConnectionParser::addFunnelRelationshipToConnection(const
std::shared_ptr<minifi::Connection>& connection) const {
+ utils::Identifier srcUUID;
+ try {
+ srcUUID = getSourceUUIDFromYaml();
+ } catch(const std::exception&) {
+ return;
+ }
+ auto processor = parent_->findProcessorById(srcUUID);
+ if (!processor) {
+ logger_->log_error("Could not find processor with id %s",
srcUUID.to_string());
+ return;
+ }
+
+ auto& processor_ref = *processor.get();
+ if (typeid(minifi::core::Funnel) == typeid(processor_ref)) {
+ addNewRelationshipToConnection(minifi::core::Funnel::Success.getName(),
connection);
+ }
Review comment:
Added in e64b1c0d1fe231936dcde263939fbd8dcfff4083
--
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]