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/06/01 13:34:52 UTC

[GitHub] [nifi-minifi-cpp] fgerlits commented on a diff in pull request #1334: MINIFICPP-1803 Do not instantiate all classes at heartbeat

fgerlits commented on code in PR #1334:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1334#discussion_r886814428


##########
libminifi/include/controllers/keyvalue/AbstractAutoPersistingKeyValueStoreService.h:
##########
@@ -30,23 +29,17 @@
 #include "core/logging/LoggerConfiguration.h"
 #include "utils/Export.h"
 
-
-namespace org {
-namespace apache {
-namespace nifi {
-namespace minifi {
-namespace controllers {
+namespace org::apache::nifi::minifi::controllers {
 
 class AbstractAutoPersistingKeyValueStoreService : virtual public PersistableKeyValueStoreService {
  public:
   explicit AbstractAutoPersistingKeyValueStoreService(const std::string& name, const utils::Identifier& uuid = {});
 
   ~AbstractAutoPersistingKeyValueStoreService() override;
 
-  MINIFIAPI static core::Property AlwaysPersist;
-  MINIFIAPI static core::Property AutoPersistenceInterval;
+  static constexpr const char* AlwaysPersistPropertyName = "Always Persist";
+  static constexpr const char* AutoPersistenceIntervalPropertyName = "Auto Persistence Interval";

Review Comment:
   This class has two derived classes, in two different libraries: `UnorderedMapPersistableKeyValueStoreService` in `libminifi` and `RocksDbPersistableKeyValueStoreService` in `rocksdb-repos`.  The static definitions of each inheritance hierarchy need to be in a single translation unit to ensure the correct order of initialization at startup, but that is not possible if they are in different libraries.  So instead of the two derived classes inheriting these two properties, they define them separately, but they both use these constants to indicate that they are really the same properties.



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