You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/11/30 13:22:41 UTC

[GitHub] [nifi-minifi-cpp] szaszm commented on a diff in pull request #1465: MINIFICPP-1975 Volatile and persistent combination of repositories should be avoided

szaszm commented on code in PR #1465:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1465#discussion_r1035957713


##########
controller/Controller.h:
##########
@@ -259,13 +261,16 @@ std::shared_ptr<org::apache::nifi::minifi::core::controller::ControllerService>
   if (!flow_repo) {
     throw org::apache::nifi::minifi::Exception(org::apache::nifi::minifi::REPOSITORY_EXCEPTION, "Could not create flowfile repository");
   }
-
   flow_repo->initialize(configuration);
 
-
   configuration->get(org::apache::nifi::minifi::Configure::nifi_content_repository_class_name, content_repo_class);
 
   const std::shared_ptr content_repo = org::apache::nifi::minifi::core::createContentRepository(content_repo_class, true, "content");
+  const bool is_flow_repo_non_persistent = flow_repo->isNoop() || std::dynamic_pointer_cast<org::apache::nifi::minifi::core::repository::VolatileFlowFileRepository>(flow_repo) != nullptr;
+  const bool is_content_repo_non_persistent = std::dynamic_pointer_cast<org::apache::nifi::minifi::core::repository::VolatileContentRepository>(content_repo) != nullptr;

Review Comment:
   `typeid` equality check is faster than `dynamic_cast`.



-- 
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