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

Method enableControllerService

libminifi/src/SchedulingAgent.cpp:42–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42std::future<utils::TaskRescheduleInfo> SchedulingAgent::enableControllerService(std::shared_ptr<core::controller::ControllerServiceNode> &serviceNode) {
43 logger_->log_info("Enabling CSN in SchedulingAgent %s", serviceNode->getName());
44 // reference the enable function from serviceNode
45 std::function<utils::TaskRescheduleInfo()> f_ex = [serviceNode] {
46 serviceNode->enable();
47 return utils::TaskRescheduleInfo::Done();
48 };
49
50 // only need to run this once.
51 auto monitor = utils::make_unique<utils::ComplexMonitor>();
52 utils::Worker<utils::TaskRescheduleInfo> functor(f_ex, serviceNode->getUUIDStr(), std::move(monitor));
53 // move the functor into the thread pool. While a future is returned
54 // we aren't terribly concerned with the result.
55 std::future<utils::TaskRescheduleInfo> future;
56 thread_pool_.execute(std::move(functor), future);
57 if (future.valid())
58 future.wait();
59 return future;
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());

Callers 1

mainFunction · 0.45

Calls 6

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

Tested by 1

mainFunction · 0.36