szaszm commented on a change in pull request #1177:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1177#discussion_r712013951
##########
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:
Now that you made RocksDbStream seekable, FlowFileStream seems
unnecessary. All it does is call seek in the constructor and delegate
everything, so simply calling seek is enough IMO.
##########
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:
Instead of making the whole function a template, I think it would be
simpler to make the content repository an optional parameter.
--
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]