MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / disableControllerService

Method disableControllerService

libminifi/src/SchedulingAgent.cpp:62–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62std::future<utils::TaskRescheduleInfo> SchedulingAgent::disableControllerService(std::shared_ptr<core::controller::ControllerServiceNode> &serviceNode) {
63 logger_->log_info("Disabling CSN in SchedulingAgent %s", serviceNode->getName());
64 // reference the disable function from serviceNode
65 std::function<utils::TaskRescheduleInfo()> f_ex = [serviceNode] {
66 serviceNode->disable();
67 return utils::TaskRescheduleInfo::Done();
68 };
69
70 // only need to run this once.
71 auto monitor = utils::make_unique<utils::ComplexMonitor>();
72 utils::Worker<utils::TaskRescheduleInfo> functor(f_ex, serviceNode->getUUIDStr(), std::move(monitor));
73
74 // move the functor into the thread pool. While a future is returned
75 // we aren't terribly concerned with the result.
76 std::future<utils::TaskRescheduleInfo> future;
77 thread_pool_.execute(std::move(functor), future);
78 if (future.valid())
79 future.wait();
80 return future;
81}
82
83bool SchedulingAgent::hasTooMuchOutGoing(const std::shared_ptr<core::Processor>& processor) {
84 return processor->flowFilesOutGoingFull();

Callers

nothing calls this directly

Calls 6

log_infoMethod · 0.80
disableMethod · 0.80
getNameMethod · 0.45
getUUIDStrMethod · 0.45
executeMethod · 0.45
validMethod · 0.45

Tested by

no test coverage detected