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



##########
File path: libminifi/src/FlowController.cpp
##########
@@ -311,56 +302,62 @@ void FlowController::unload() {
   if (running_) {
     stop();
   }
-  if (initialized_) {
-    logger_->log_info("Unload Flow Controller");
-    initialized_ = false;
-    name_ = "";
-  }
+  logger_->log_info("Unload Flow Controller");
+  name_ = "";
 }
 
-void FlowController::load(const std::shared_ptr<core::ProcessGroup> &root, 
bool reload) {
+void FlowController::restartThreadPool() {
+  auto base_shared_ptr = 
std::dynamic_pointer_cast<core::controller::ControllerServiceProvider>(shared_from_this());
+  thread_pool_.shutdown();
+  
thread_pool_.setMaxConcurrentTasks(configuration_->getInt(Configure::nifi_flow_engine_threads,
 2));
+  thread_pool_.setControllerServiceProvider(base_shared_ptr);
+  thread_pool_.start();
+}
+
+void FlowController::initializeUninitializedSchedulers() {
+  conditionalReloadScheduler<TimerDrivenSchedulingAgent>(timer_scheduler_, 
!timer_scheduler_);
+  conditionalReloadScheduler<EventDrivenSchedulingAgent>(event_scheduler_, 
!event_scheduler_);
+  conditionalReloadScheduler<CronDrivenSchedulingAgent>(cron_scheduler_, 
!cron_scheduler_);
+}
+
+void FlowController::reinitializeSchedulersWithNewThreadPool() {
+  using ControllerServiceProvider = 
core::controller::ControllerServiceProvider;

Review comment:
       The reason I introduced this was actually because the lines were too 
long otherwise, and my ocd wanted them to align :D.
   
   Will add an alias for the `gsl::not_null`. 




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