lordgamez commented on code in PR #1497:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1497#discussion_r1112788277
##########
libminifi/test/flow-tests/TestControllerWithFlow.h:
##########
@@ -64,14 +65,12 @@ class TestControllerWithFlow: public TestController {
REQUIRE(content_repo->initialize(configuration_));
std::shared_ptr<minifi::io::StreamFactory> stream_factory =
minifi::io::StreamFactory::getInstance(configuration_);
- auto flow =
std::make_unique<core::YamlConfiguration>(core::ConfigurationContext{ff_repo,
content_repo, stream_factory, configuration_, yaml_path_.string()});
+ auto flow =
std::make_shared<core::YamlConfiguration>(core::ConfigurationContext{ff_repo,
content_repo, stream_factory, configuration_, yaml_path_.string()});
auto root = flow->getRoot();
root_ = root.get();
- controller_ = std::make_shared<minifi::FlowController>(
- prov_repo, ff_repo, configuration_,
- std::move(flow),
- content_repo, DEFAULT_ROOT_GROUP_NAME,
- std::make_shared<utils::file::FileSystem>(), []{});
+ auto metrics_publisher_store =
std::make_unique<minifi::state::MetricsPublisherStore>(configuration_,
prov_repo, ff_repo, flow);
+ metrics_publisher_store_ = metrics_publisher_store.get();
Review Comment:
The raw pointer is used in the `PythonManifestTests` to retrieve the C2
metrics publisher through it. Not the cleanest solution, but I could not find a
better one. The raw pointer should have the same lifetime as the `controller_`,
its owner so it should be okay.
--
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]