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

Method stopProcessing

libminifi/src/core/ProcessGroup.cpp:216–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216void ProcessGroup::stopProcessing(const std::shared_ptr<TimerDrivenSchedulingAgent>& timeScheduler, const std::shared_ptr<EventDrivenSchedulingAgent> &eventScheduler,
217 const std::shared_ptr<CronDrivenSchedulingAgent> &cronScheduler, const std::function<bool(const std::shared_ptr<Processor>&)>& filter) {
218 std::lock_guard<std::recursive_mutex> lock(mutex_);
219
220 if (onScheduleTimer_) {
221 onScheduleTimer_->stop();
222 }
223
224 onScheduleTimer_.reset();
225
226 try {
227 // Stop all the processor node, input and output ports
228 for (const auto &processor : processors_) {
229 if (!filter(processor)) {
230 continue;
231 }
232 logger_->log_debug("Stopping %s", processor->getName());
233 switch (processor->getSchedulingStrategy()) {
234 case TIMER_DRIVEN:
235 timeScheduler->unschedule(processor);
236 break;
237 case EVENT_DRIVEN:
238 eventScheduler->unschedule(processor);
239 break;
240 case CRON_DRIVEN:
241 cronScheduler->unschedule(processor);
242 break;
243 }
244 }
245
246 for (ProcessGroup* childGroup : child_process_groups_) {
247 childGroup->stopProcessing(timeScheduler, eventScheduler, cronScheduler, filter);
248 }
249 } catch (std::exception &exception) {
250 logger_->log_debug("Caught Exception %s", exception.what());
251 throw;
252 } catch (...) {
253 logger_->log_debug("Caught Exception during process group stop processing");
254 throw;
255 }
256}
257
258std::shared_ptr<Processor> ProcessGroup::findProcessorById(const utils::Identifier& uuid) const {
259 const auto id_matches = [&] (const std::shared_ptr<Processor>& processor) {

Callers 1

stopMethod · 0.80

Calls 7

log_debugMethod · 0.80
getSchedulingStrategyMethod · 0.80
unscheduleMethod · 0.80
stopMethod · 0.45
resetMethod · 0.45
getNameMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected