martinzink commented on a change in pull request #1177:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1177#discussion_r712118674



##########
File path: libminifi/test/TestBase.h
##########
@@ -427,12 +427,18 @@ class TestController {
     flow_version_ = 
std::make_shared<minifi::state::response::FlowVersion>("test", "test", "test");
   }
 
+  std::shared_ptr<TestPlan> createPlan(std::shared_ptr<minifi::Configure> 
configuration = nullptr, const char* state_dir = nullptr) {
+    return 
createPlan<core::repository::VolatileContentRepository>(configuration, 
state_dir);
+  }
+
+  template<class ContentRepositoryClass>
   std::shared_ptr<TestPlan> createPlan(std::shared_ptr<minifi::Configure> 
configuration = nullptr, const char* state_dir = nullptr) {
     if (configuration == nullptr) {
       configuration = std::make_shared<minifi::Configure>();
       
configuration->set(minifi::Configure::nifi_state_management_provider_local_class_name,
 "UnorderedMapKeyValueStoreService");
+      
configuration->set(minifi::Configure::nifi_dbcontent_repository_directory_default,
 createTempDirectory());
     }
-    std::shared_ptr<core::ContentRepository> content_repo = 
std::make_shared<core::repository::VolatileContentRepository>();
+    std::shared_ptr<core::ContentRepository> content_repo = 
std::make_shared<ContentRepositoryClass>();

Review comment:
       Good idea changed it in 
https://github.com/apache/nifi-minifi-cpp/pull/1177/commits/3026364fda3a6b5b6512a3ba2c3b0a6dccfd7501

##########
File path: libminifi/src/core/ProcessSession.cpp
##########
@@ -311,9 +333,8 @@ int64_t ProcessSession::read(const 
std::shared_ptr<core::FlowFile> &flow, InputS
       throw Exception(FILE_OPERATION_EXCEPTION, "Failed to open flowfile 
content for read");
     }
 
-    stream->seek(flow->getOffset());
-
-    auto ret = callback->process(stream);
+    auto flow_file_stream = std::make_shared<FlowFileStream>(stream, flow);
+    auto ret = callback->process(flow_file_stream);

Review comment:
       Sure thing, that would make it clearer. added in 
https://github.com/apache/nifi-minifi-cpp/pull/1177/commits/3026364fda3a6b5b6512a3ba2c3b0a6dccfd7501




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


Reply via email to