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 2020/09/07 16:27:36 UTC

[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #890: MINIFICPP-1288 - FlowController start/load refactor

szaszm commented on a change in pull request #890:
URL: https://github.com/apache/nifi-minifi-cpp/pull/890#discussion_r484513034



##########
File path: libminifi/src/FlowController.cpp
##########
@@ -320,12 +320,12 @@ void FlowController::initializeUninitializedSchedulers() {
   conditionalReloadScheduler<CronDrivenSchedulingAgent>(cron_scheduler_, !cron_scheduler_);
 }
 
-void FlowController::reinitializeSchedulersWithNewThreadPool() {
-  using ControllerServiceProvider = core::controller::ControllerServiceProvider;
+void FlowController::reinitializeSchedulersWithClearedThreadPool() {
+  using NonNullControllerServiceProviderPtr = gsl::not_null<core::controller::ControllerServiceProvider*>;
   restartThreadPool();
-  timer_scheduler_ = std::make_shared<TimerDrivenSchedulingAgent>(gsl::not_null<ControllerServiceProvider*>(this), provenance_repo_, flow_file_repo_, content_repo_, configuration_, thread_pool_);
-  event_scheduler_ = std::make_shared<EventDrivenSchedulingAgent>(gsl::not_null<ControllerServiceProvider*>(this), provenance_repo_, flow_file_repo_, content_repo_, configuration_, thread_pool_);
-  cron_scheduler_ = std::make_shared<CronDrivenSchedulingAgent>(gsl::not_null<ControllerServiceProvider*>(this), provenance_repo_, flow_file_repo_, content_repo_, configuration_, thread_pool_);
+  timer_scheduler_ = std::make_shared<TimerDrivenSchedulingAgent>(NonNullControllerServiceProviderPtr(this), provenance_repo_, flow_file_repo_, content_repo_, configuration_, thread_pool_);
+  event_scheduler_ = std::make_shared<EventDrivenSchedulingAgent>(NonNullControllerServiceProviderPtr(this), provenance_repo_, flow_file_repo_, content_repo_, configuration_, thread_pool_);
+  cron_scheduler_ = std::make_shared<CronDrivenSchedulingAgent>(NonNullControllerServiceProviderPtr(this), provenance_repo_, flow_file_repo_, content_repo_, configuration_, thread_pool_);

Review comment:
       Consider using `gsl::make_not_null` and relying on implicit conversion to base class pointer.




----------------------------------------------------------------
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:
users@infra.apache.org