This is an automated email from the ASF dual-hosted git repository. adebreceni pushed a commit to branch minifi-api-reduced in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
commit c04a6d89acba6c03ab87648466ee6aecf973f95b Author: Adam Debreceni <[email protected]> AuthorDate: Thu Apr 24 11:48:55 2025 +0200 Rebase fix --- extension-utils/include/core/AbstractProcessor.h | 5 +---- extensions/kubernetes/processors/CollectKubernetesPodMetrics.h | 7 ++----- extensions/pdh/PerformanceDataMonitor.h | 6 +++--- extensions/procfs/processors/ProcFsMonitor.h | 5 +---- extensions/python/ExecutePythonProcessor.h | 6 +----- extensions/smb/FetchSmb.h | 5 +---- extensions/smb/ListSmb.h | 5 +---- extensions/smb/PutSmb.h | 5 +---- extensions/windows-event-log/TailEventLog.h | 5 +---- 9 files changed, 12 insertions(+), 37 deletions(-) diff --git a/extension-utils/include/core/AbstractProcessor.h b/extension-utils/include/core/AbstractProcessor.h index 40710d205..f4a76f57e 100644 --- a/extension-utils/include/core/AbstractProcessor.h +++ b/extension-utils/include/core/AbstractProcessor.h @@ -32,10 +32,7 @@ namespace org::apache::nifi::minifi::core { template<typename ProcessorT> class AbstractProcessor : public ProcessorImpl { public: - explicit AbstractProcessor(std::string_view name, const utils::Identifier& uuid = {}) - : ProcessorImpl(name, uuid) { - logger_ = core::logging::LoggerFactory<ProcessorT>::getLogger(uuid_); - } + using ProcessorImpl::ProcessorImpl; void initialize() final { static_assert(std::is_same_v<typename decltype(ProcessorT::Properties)::value_type, PropertyReference>); diff --git a/extensions/kubernetes/processors/CollectKubernetesPodMetrics.h b/extensions/kubernetes/processors/CollectKubernetesPodMetrics.h index 31a70cc0d..fae416df8 100644 --- a/extensions/kubernetes/processors/CollectKubernetesPodMetrics.h +++ b/extensions/kubernetes/processors/CollectKubernetesPodMetrics.h @@ -21,7 +21,7 @@ #include "../controllerservice/KubernetesControllerService.h" #include "core/logging/LoggerFactory.h" -#include "core/Processor.h" +#include "core/ProcessorImpl.h" #include "core/PropertyDefinition.h" #include "core/PropertyDefinitionBuilder.h" @@ -29,10 +29,7 @@ namespace org::apache::nifi::minifi::processors { class CollectKubernetesPodMetrics : public core::ProcessorImpl { public: - explicit CollectKubernetesPodMetrics(const std::string_view name, const utils::Identifier& uuid = {}) - : ProcessorImpl(name, uuid) { - logger_ = core::logging::LoggerFactory<CollectKubernetesPodMetrics>::getLogger(uuid_); - } + using ProcessorImpl::ProcessorImpl; EXTENSIONAPI static constexpr const char* Description = "A processor which collects pod metrics when MiNiFi is run inside Kubernetes."; diff --git a/extensions/pdh/PerformanceDataMonitor.h b/extensions/pdh/PerformanceDataMonitor.h index b644d81a5..4e52da822 100644 --- a/extensions/pdh/PerformanceDataMonitor.h +++ b/extensions/pdh/PerformanceDataMonitor.h @@ -49,9 +49,9 @@ class PerformanceDataMonitor final : public core::ProcessorImpl { static constexpr const char* PRETTY_FORMAT_STR = "Pretty"; static constexpr const char* COMPACT_FORMAT_STR = "Compact"; - explicit PerformanceDataMonitor(const std::string_view name, utils::Identifier uuid = utils::Identifier()) - : ProcessorImpl(name, uuid), output_format_(OutputFormat::JSON), pretty_output_(false), - decimal_places_(std::nullopt), logger_(core::logging::LoggerFactory<PerformanceDataMonitor>::getLogger()), + explicit PerformanceDataMonitor(core::ProcessorMetadata info) + : ProcessorImpl(info), output_format_(OutputFormat::JSON), pretty_output_(false), + decimal_places_(std::nullopt), pdh_query_(nullptr), resource_consumption_counters_() {} ~PerformanceDataMonitor() override; diff --git a/extensions/procfs/processors/ProcFsMonitor.h b/extensions/procfs/processors/ProcFsMonitor.h index c4ce0cd28..d20649771 100644 --- a/extensions/procfs/processors/ProcFsMonitor.h +++ b/extensions/procfs/processors/ProcFsMonitor.h @@ -55,10 +55,7 @@ enum class ResultRelativeness { class ProcFsMonitor final : public core::ProcessorImpl { public: - explicit ProcFsMonitor(const std::string_view name, utils::Identifier uuid = utils::Identifier()) - : ProcessorImpl(name, uuid) { - logger_ = core::logging::LoggerFactory<ProcFsMonitor>::getLogger(uuid_); - } + using ProcessorImpl::ProcessorImpl; ~ProcFsMonitor() override = default; EXTENSIONAPI static constexpr const char* Description = "This processor can create FlowFiles with various performance data through the proc pseudo-filesystem. (Linux only)"; diff --git a/extensions/python/ExecutePythonProcessor.h b/extensions/python/ExecutePythonProcessor.h index f74ce8cc1..c54f1840f 100644 --- a/extensions/python/ExecutePythonProcessor.h +++ b/extensions/python/ExecutePythonProcessor.h @@ -44,10 +44,7 @@ class ExecutePythonProcessor : public core::ProcessorImpl { : ProcessorImpl(info), processor_initialized_(false), python_dynamic_(false), - reload_on_script_change_(true) { - logger_ = core::logging::LoggerFactory<ExecutePythonProcessor>::getLogger(uuid_); - python_logger_ = core::logging::LoggerFactory<ExecutePythonProcessor>::getAliasedLogger(getName()); - } + reload_on_script_change_(true) {} EXTENSIONAPI static constexpr const char* Description = "Executes a script given the flow file and a process session. " "The script is responsible for handling the incoming flow file (transfer to SUCCESS or remove, e.g.) as well as " @@ -160,7 +157,6 @@ class ExecutePythonProcessor : public core::ProcessorImpl { bool reload_on_script_change_; std::optional<std::chrono::file_clock::time_point> last_script_write_time_; std::string script_file_path_; - std::shared_ptr<core::logging::Logger> python_logger_; std::unique_ptr<PythonScriptEngine> python_script_engine_; std::optional<std::string> python_class_name_; std::vector<std::filesystem::path> python_paths_; diff --git a/extensions/smb/FetchSmb.h b/extensions/smb/FetchSmb.h index 3d3995b6d..044c51c0c 100644 --- a/extensions/smb/FetchSmb.h +++ b/extensions/smb/FetchSmb.h @@ -39,10 +39,7 @@ namespace org::apache::nifi::minifi::extensions::smb { class FetchSmb final : public core::ProcessorImpl { public: - explicit FetchSmb(const std::string_view name, const utils::Identifier& uuid = {}) - : core::ProcessorImpl(name, uuid) { - logger_ = core::logging::LoggerFactory<FetchSmb>::getLogger(uuid_); - } + using ProcessorImpl::ProcessorImpl; EXTENSIONAPI static constexpr const char* Description = "Fetches files from a SMB Share. Designed to be used in tandem with ListSmb."; diff --git a/extensions/smb/ListSmb.h b/extensions/smb/ListSmb.h index b00e64b04..52cc3566c 100644 --- a/extensions/smb/ListSmb.h +++ b/extensions/smb/ListSmb.h @@ -39,10 +39,7 @@ namespace org::apache::nifi::minifi::extensions::smb { class ListSmb : public core::ProcessorImpl { public: - explicit ListSmb(const std::string_view name, const utils::Identifier& uuid = {}) - : core::ProcessorImpl(name, uuid) { - logger_ = core::logging::LoggerFactory<ListSmb>::getLogger(uuid_); - } + using ProcessorImpl::ProcessorImpl; EXTENSIONAPI static constexpr const char* Description = "Retrieves a listing of files from an SMB share. For each file that is listed, " "creates a FlowFile that represents the file so that it can be fetched in conjunction with FetchSmb."; diff --git a/extensions/smb/PutSmb.h b/extensions/smb/PutSmb.h index a497e3b3c..37ff29242 100644 --- a/extensions/smb/PutSmb.h +++ b/extensions/smb/PutSmb.h @@ -31,10 +31,7 @@ namespace org::apache::nifi::minifi::extensions::smb { class PutSmb final : public core::ProcessorImpl { public: - explicit PutSmb(const std::string_view name, const utils::Identifier& uuid = {}) - : core::ProcessorImpl(name, uuid) { - logger_ = core::logging::LoggerFactory<PutSmb>::getLogger(uuid_); - } + using ProcessorImpl::ProcessorImpl; enum class FileExistsResolutionStrategy { fail, diff --git a/extensions/windows-event-log/TailEventLog.h b/extensions/windows-event-log/TailEventLog.h index e8b606f64..c5bd991b2 100644 --- a/extensions/windows-event-log/TailEventLog.h +++ b/extensions/windows-event-log/TailEventLog.h @@ -44,9 +44,7 @@ const char log_name[255] = "Application"; class TailEventLog : public core::ProcessorImpl { public: - explicit TailEventLog(const std::string& name, const utils::Identifier& uuid = {}) - : core::ProcessorImpl(name, uuid) { - } + using ProcessorImpl::ProcessorImpl; virtual ~TailEventLog() = default; EXTENSIONAPI static constexpr const char* Description = "Windows event log reader that functions as a stateful tail of the provided windows event log name"; @@ -129,7 +127,6 @@ class TailEventLog : public core::ProcessorImpl { DWORD num_records_; HANDLE log_handle_; - std::shared_ptr<core::logging::Logger> logger_ = core::logging::LoggerFactory<TailEventLog>::getLogger(); }; } /* namespace processors */
