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/12/05 10:44:23 UTC

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

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


##########
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:
   does `typeid` handle inheritance as well? if we create a `FasterVolatileContentRepo` I presume `typeid` based comparison will fail, as we do it once I do not think speed is of concern, being volatile (or persistent) seems to be a property of any repository, maybe we should let the objects themselves report their capabilities through a virtual method?



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