| 361 | } |
| 362 | |
| 363 | int16_t FlowController::start() { |
| 364 | std::lock_guard<std::recursive_mutex> flow_lock(mutex_); |
| 365 | if (!initialized_) { |
| 366 | logger_->log_error("Can not start Flow Controller because it has not been initialized"); |
| 367 | return -1; |
| 368 | } else { |
| 369 | if (!running_) { |
| 370 | logger_->log_info("Starting Flow Controller"); |
| 371 | controller_service_provider_impl_->enableAllControllerServices(); |
| 372 | this->timer_scheduler_->start(); |
| 373 | this->event_scheduler_->start(); |
| 374 | this->cron_scheduler_->start(); |
| 375 | |
| 376 | if (this->root_ != nullptr) { |
| 377 | start_time_ = std::chrono::steady_clock::now(); |
| 378 | // watch out, this might immediately start the processors |
| 379 | // as the thread_pool_ is started in load() |
| 380 | this->root_->startProcessing(timer_scheduler_, event_scheduler_, cron_scheduler_); |
| 381 | } |
| 382 | C2Client::initialize(this, shared_from_this()); |
| 383 | running_ = true; |
| 384 | this->protocol_->start(); |
| 385 | this->provenance_repo_->start(); |
| 386 | this->flow_file_repo_->start(); |
| 387 | thread_pool_.start(); |
| 388 | logger_->log_info("Started Flow Controller"); |
| 389 | } |
| 390 | return 0; |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | int16_t FlowController::applyUpdate(const std::string &source, const std::string &configuration, bool persist) { |
| 395 | if (applyConfiguration(source, configuration)) { |
no test coverage detected