adamdebreceni commented on a change in pull request #932:
URL: https://github.com/apache/nifi-minifi-cpp/pull/932#discussion_r514137427



##########
File path: 
libminifi/src/controllers/keyvalue/PersistableKeyValueStoreService.cpp
##########
@@ -29,20 +29,29 @@ 
PersistableKeyValueStoreService::PersistableKeyValueStoreService(const std::stri
 
 PersistableKeyValueStoreService::~PersistableKeyValueStoreService() = default;
 
-bool PersistableKeyValueStoreService::setImpl(const std::string& key, const 
std::string& value) {
-  return set(key, value);
+bool PersistableKeyValueStoreService::setImpl(const utils::Identifier& key, 
const std::string& value) {
+  return set(key.to_string(), value);
 }
 
-bool PersistableKeyValueStoreService::getImpl(const std::string& key, 
std::string& value) {
-  return get(key, value);
+bool PersistableKeyValueStoreService::getImpl(const utils::Identifier& key, 
std::string& value) {
+  return get(key.to_string(), value);
 }
 
-bool PersistableKeyValueStoreService::getImpl(std::unordered_map<std::string, 
std::string>& kvs) {
-  return get(kvs);
+bool PersistableKeyValueStoreService::getImpl(std::map<utils::Identifier, 
std::string>& kvs) {
+  std::unordered_map<std::string, std::string> states;
+  if (!get(states)) {
+    return false;
+  }
+  kvs.clear();
+  for (const auto& state : states) {
+    const auto uuid = utils::Identifier::parse(state.first);
+    kvs[uuid.value()] = state.second;

Review comment:
       rewrote it, to ignore such cases, but log errors, (should be refactored 
to contain an instance of `KeyValueStoreService` instead of extending it)




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to