| 634 | } |
| 635 | |
| 636 | void TailFile::onTrigger(const std::shared_ptr<core::ProcessContext> &, const std::shared_ptr<core::ProcessSession> &session) { |
| 637 | std::lock_guard<std::mutex> tail_lock(tail_file_mutex_); |
| 638 | |
| 639 | if (tail_mode_ == Mode::MULTIPLE) { |
| 640 | if (last_multifile_lookup_ + lookup_frequency_ < std::chrono::steady_clock::now()) { |
| 641 | logger_->log_debug("Lookup frequency %" PRId64 " ms have elapsed, doing new multifile lookup", int64_t{lookup_frequency_.count()}); |
| 642 | doMultifileLookup(); |
| 643 | } else { |
| 644 | logger_->log_trace("Skipping multifile lookup"); |
| 645 | } |
| 646 | } |
| 647 | |
| 648 | // iterate over file states. may modify them |
| 649 | for (auto &state : tail_states_) { |
| 650 | processFile(session, state.first, state.second); |
| 651 | } |
| 652 | |
| 653 | if (!session->existsFlowFileInRelationship(Success)) { |
| 654 | yield(); |
| 655 | } |
| 656 | } |
| 657 | |
| 658 | void TailFile::processFile(const std::shared_ptr<core::ProcessSession> &session, |
| 659 | const std::string &full_file_name, |
nothing calls this directly
no test coverage detected