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 cbabc99216466aec60a6510685339ed25f1e8e6a Author: Adam Debreceni <[email protected]> AuthorDate: Mon May 12 11:28:31 2025 +0200 Linter fix --- .../AzureDataLakeStorageFileProcessorBase.h | 2 +- .../azure/tests/AzureBlobStorageTestsFixture.h | 1 - .../azure/tests/AzureDataLakeStorageTestsFixture.h | 4 +- .../azure/tests/ListAzureBlobStorageTests.cpp | 5 +- .../azure/tests/ListAzureDataLakeStorageTests.cpp | 4 +- extensions/pdh/PerformanceDataMonitor.cpp | 6 +- libminifi/include/Funnel.h | 3 +- libminifi/include/Port.h | 4 +- .../reporting/SiteToSiteProvenanceReportingTask.h | 3 +- libminifi/src/core/ClassLoader.cpp | 2 +- libminifi/src/core/ConfigurableComponentImpl.cpp | 149 ------------------ libminifi/src/core/Connectable.cpp | 173 --------------------- libminifi/src/core/Processor.cpp | 1 - libminifi/test/libtest/unit/DummyProcessor.h | 2 +- libminifi/test/libtest/unit/ProcessorUtils.h | 2 +- libminifi/test/libtest/unit/TestBase.h | 2 +- 16 files changed, 25 insertions(+), 338 deletions(-) diff --git a/extensions/azure/processors/AzureDataLakeStorageFileProcessorBase.h b/extensions/azure/processors/AzureDataLakeStorageFileProcessorBase.h index acb80568a..55d522ff5 100644 --- a/extensions/azure/processors/AzureDataLakeStorageFileProcessorBase.h +++ b/extensions/azure/processors/AzureDataLakeStorageFileProcessorBase.h @@ -41,7 +41,7 @@ class AzureDataLakeStorageFileProcessorBase : public AzureDataLakeStorageProcess ~AzureDataLakeStorageFileProcessorBase() override = default; protected: - explicit AzureDataLakeStorageFileProcessorBase(core::ProcessorMetadata info,std::unique_ptr<storage::DataLakeStorageClient> data_lake_storage_client) + explicit AzureDataLakeStorageFileProcessorBase(core::ProcessorMetadata info, std::unique_ptr<storage::DataLakeStorageClient> data_lake_storage_client) : AzureDataLakeStorageProcessorBase(info, std::move(data_lake_storage_client)) { } diff --git a/extensions/azure/tests/AzureBlobStorageTestsFixture.h b/extensions/azure/tests/AzureBlobStorageTestsFixture.h index 897a7905f..181504303 100644 --- a/extensions/azure/tests/AzureBlobStorageTestsFixture.h +++ b/extensions/azure/tests/AzureBlobStorageTestsFixture.h @@ -33,7 +33,6 @@ #include "processors/UpdateAttribute.h" #include "utils/file/FileUtils.h" #include "MockBlobStorage.h" -#include "core/Processor.h" const std::string CONTAINER_NAME = "test-container"; const std::string STORAGE_ACCOUNT_NAME = "test-account"; diff --git a/extensions/azure/tests/AzureDataLakeStorageTestsFixture.h b/extensions/azure/tests/AzureDataLakeStorageTestsFixture.h index e7f505f3c..006ffa28c 100644 --- a/extensions/azure/tests/AzureDataLakeStorageTestsFixture.h +++ b/extensions/azure/tests/AzureDataLakeStorageTestsFixture.h @@ -62,7 +62,9 @@ class AzureDataLakeStorageTestsFixture { mock_data_lake_storage_client_ptr_ = mock_data_lake_storage_client.get(); auto uuid = utils::IdGenerator::getIdGenerator()->generate(); auto impl = std::unique_ptr<AzureDataLakeStorageProcessor>( - new AzureDataLakeStorageProcessor({.uuid = uuid, .name = "AzureDataLakeStorageProcessor", .logger = logging::LoggerFactory<AzureDataLakeStorageProcessor>::getLogger(uuid)}, std::move(mock_data_lake_storage_client))); + new AzureDataLakeStorageProcessor({ + .uuid = uuid, .name = "AzureDataLakeStorageProcessor", + .logger = logging::LoggerFactory<AzureDataLakeStorageProcessor>::getLogger(uuid)}, std::move(mock_data_lake_storage_client))); auto azure_data_lake_storage_unique_ptr = std::make_unique<core::Processor>(impl->getName(), impl->getUUID(), std::move(impl)); azure_data_lake_storage_ = azure_data_lake_storage_unique_ptr.get(); auto input_dir = test_controller_.createTempDirectory(); diff --git a/extensions/azure/tests/ListAzureBlobStorageTests.cpp b/extensions/azure/tests/ListAzureBlobStorageTests.cpp index 48c222d58..2717469ec 100644 --- a/extensions/azure/tests/ListAzureBlobStorageTests.cpp +++ b/extensions/azure/tests/ListAzureBlobStorageTests.cpp @@ -46,7 +46,10 @@ class ListAzureBlobStorageTestsFixture { auto mock_blob_storage = std::make_unique<MockBlobStorage>(); mock_blob_storage_ptr_ = mock_blob_storage.get(); auto uuid = utils::IdGenerator::getIdGenerator()->generate(); - auto impl = std::make_unique<minifi::azure::processors::ListAzureBlobStorage>(core::ProcessorMetadata{.uuid = uuid, .name = "ListAzureBlobStorage", .logger = logging::LoggerFactory<minifi::azure::processors::ListAzureBlobStorage>::getLogger(uuid)}, std::move(mock_blob_storage)); + auto impl = std::make_unique<minifi::azure::processors::ListAzureBlobStorage>( + core::ProcessorMetadata{ + .uuid = uuid, .name = "ListAzureBlobStorage", + .logger = logging::LoggerFactory<minifi::azure::processors::ListAzureBlobStorage>::getLogger(uuid)}, std::move(mock_blob_storage)); auto list_azure_blob_storage_unique_ptr = std::make_unique<core::Processor>(impl->getName(), impl->getUUID(), std::move(impl)); list_azure_blob_storage_ = list_azure_blob_storage_unique_ptr.get(); diff --git a/extensions/azure/tests/ListAzureDataLakeStorageTests.cpp b/extensions/azure/tests/ListAzureDataLakeStorageTests.cpp index 9335336f2..4cc0fa5c7 100644 --- a/extensions/azure/tests/ListAzureDataLakeStorageTests.cpp +++ b/extensions/azure/tests/ListAzureDataLakeStorageTests.cpp @@ -44,7 +44,9 @@ class ListAzureDataLakeStorageTestsFixture { mock_data_lake_storage_client_ptr_ = mock_data_lake_storage_client.get(); auto uuid = utils::IdGenerator::getIdGenerator()->generate(); auto impl = std::unique_ptr<minifi::azure::processors::ListAzureDataLakeStorage>( - new minifi::azure::processors::ListAzureDataLakeStorage({.uuid = uuid, .name = "ListAzureDataLakeStorage", .logger = logging::LoggerFactory<minifi::azure::processors::ListAzureDataLakeStorage>::getLogger(uuid)}, std::move(mock_data_lake_storage_client))); + new minifi::azure::processors::ListAzureDataLakeStorage({ + .uuid = uuid, .name = "ListAzureDataLakeStorage", + .logger = logging::LoggerFactory<minifi::azure::processors::ListAzureDataLakeStorage>::getLogger(uuid)}, std::move(mock_data_lake_storage_client))); auto list_azure_data_lake_storage_unique_ptr = std::make_unique<core::Processor>(impl->getName(), impl->getUUID(), std::move(impl)); list_azure_data_lake_storage_ = list_azure_data_lake_storage_unique_ptr.get(); diff --git a/extensions/pdh/PerformanceDataMonitor.cpp b/extensions/pdh/PerformanceDataMonitor.cpp index e3ff27ad6..952c27706 100644 --- a/extensions/pdh/PerformanceDataMonitor.cpp +++ b/extensions/pdh/PerformanceDataMonitor.cpp @@ -65,21 +65,21 @@ void PerformanceDataMonitor::onSchedule(core::ProcessContext& context, core::Pro void PerformanceDataMonitor::onTrigger(core::ProcessContext& context, core::ProcessSession& session) { if (resource_consumption_counters_.empty()) { logger_->log_error("No valid counters for PerformanceDataMonitor"); - yield(); + context.yield(); return; } std::shared_ptr<core::FlowFile> flowFile = session.create(); if (!flowFile) { logger_->log_error("Failed to create flowfile!"); - yield(); + context.yield(); return; } PDH_STATUS collect_query_data_result = PdhCollectQueryData(pdh_query_); if (ERROR_SUCCESS != collect_query_data_result) { logger_->log_error("Error during PdhCollectQueryData, error code: {:#x}", collect_query_data_result); - yield(); + context.yield(); return; } diff --git a/libminifi/include/Funnel.h b/libminifi/include/Funnel.h index f5a37b1df..51ad1fa12 100644 --- a/libminifi/include/Funnel.h +++ b/libminifi/include/Funnel.h @@ -26,7 +26,8 @@ namespace org::apache::nifi::minifi { class Funnel final : public ForwardingNode { public: - Funnel(std::string_view name, const utils::Identifier& uuid) : ForwardingNode(core::ProcessorMetadata{.uuid = uuid, .name = std::string{name}, .logger = core::logging::LoggerFactory<Funnel>::getLogger(uuid)}) {} + Funnel(std::string_view name, const utils::Identifier& uuid) + : ForwardingNode(core::ProcessorMetadata{.uuid = uuid, .name = std::string{name}, .logger = core::logging::LoggerFactory<Funnel>::getLogger(uuid)}) {} MINIFIAPI static constexpr core::annotation::Input InputRequirement = core::annotation::Input::INPUT_REQUIRED; ADD_COMMON_VIRTUAL_FUNCTIONS_FOR_PROCESSORS diff --git a/libminifi/include/Port.h b/libminifi/include/Port.h index a8970e6bf..0cfd06133 100644 --- a/libminifi/include/Port.h +++ b/libminifi/include/Port.h @@ -34,7 +34,9 @@ class Port; class PortImpl final : public ForwardingNode { public: - PortImpl(std::string_view name, const utils::Identifier& uuid, PortType port_type) : ForwardingNode({.uuid = uuid, .name = std::string{name}, .logger = core::logging::LoggerFactory<Port>::getLogger(uuid)}), port_type_(port_type) {} + PortImpl(std::string_view name, const utils::Identifier& uuid, PortType port_type) + : ForwardingNode({.uuid = uuid, .name = std::string{name}, .logger = core::logging::LoggerFactory<Port>::getLogger(uuid)}), port_type_(port_type) {} + PortType getPortType() const { return port_type_; } diff --git a/libminifi/include/core/reporting/SiteToSiteProvenanceReportingTask.h b/libminifi/include/core/reporting/SiteToSiteProvenanceReportingTask.h index f79eb9eb7..6998e922d 100644 --- a/libminifi/include/core/reporting/SiteToSiteProvenanceReportingTask.h +++ b/libminifi/include/core/reporting/SiteToSiteProvenanceReportingTask.h @@ -35,7 +35,8 @@ namespace org::apache::nifi::minifi::core::reporting { class SiteToSiteProvenanceReportingTask : public minifi::RemoteProcessorGroupPort { public: explicit SiteToSiteProvenanceReportingTask(std::shared_ptr<Configure> configure) - : minifi::RemoteProcessorGroupPort(ReportTaskName, "", std::move(configure), utils::IdGenerator::getIdGenerator()->generate(), logging::LoggerFactory<SiteToSiteProvenanceReportingTask>::getLogger()) { + : minifi::RemoteProcessorGroupPort(ReportTaskName, "", std::move(configure), + utils::IdGenerator::getIdGenerator()->generate(), logging::LoggerFactory<SiteToSiteProvenanceReportingTask>::getLogger()) { this->setTriggerWhenEmpty(true); batch_size_ = 100; } diff --git a/libminifi/src/core/ClassLoader.cpp b/libminifi/src/core/ClassLoader.cpp index aa4be367c..ebbce7f27 100644 --- a/libminifi/src/core/ClassLoader.cpp +++ b/libminifi/src/core/ClassLoader.cpp @@ -134,7 +134,7 @@ class ProcessorFactoryWrapper : public ObjectFactoryImpl { private: std::unique_ptr<ProcessorFactory> factory_; }; -} +} // namespace void ClassLoaderImpl::registerClass(const std::string &clazz, std::unique_ptr<ProcessorFactory> factory) { registerClass(clazz, std::make_unique<ProcessorFactoryWrapper>(std::move(factory))); diff --git a/libminifi/src/core/ConfigurableComponentImpl.cpp b/libminifi/src/core/ConfigurableComponentImpl.cpp deleted file mode 100644 index 908c6a0e8..000000000 --- a/libminifi/src/core/ConfigurableComponentImpl.cpp +++ /dev/null @@ -1,149 +0,0 @@ -///** -// * -// * Licensed to the Apache Software Foundation (ASF) under one or more -// * contributor license agreements. See the NOTICE file distributed with -// * this work for additional information regarding copyright ownership. -// * The ASF licenses this file to You under the Apache License, Version 2.0 -// * (the "License"); you may not use this file except in compliance with -// * the License. You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ -// -//#include "core/ConfigurableComponentImpl.h" -// -//#include "minifi-cpp/core/Property.h" -//#include "minifi-cpp/utils/PropertyErrors.h" -// -//namespace org::apache::nifi::minifi::core { -//void ConfigurableComponentImpl::setSupportedProperties(std::span<const core::PropertyReference> properties) { -// if (!canEdit()) { return; } -// -// std::lock_guard<std::mutex> lock(configuration_mutex_); -// -// supported_properties_.clear(); -// for (const auto& item: properties) { supported_properties_.emplace(item.name, item); } -//} -// -//nonstd::expected<std::string, std::error_code> ConfigurableComponentImpl::getProperty(const std::string_view name) const { -// const std::lock_guard<std::mutex> lock(configuration_mutex_); -// const auto it = supported_properties_.find(name); -// if (it == supported_properties_.end()) { return nonstd::make_unexpected(PropertyErrorCode::NotSupportedProperty); } -// const Property& prop = it->second; -// return prop.getValue() | utils::transform([](const std::string_view value_view) -> std::string { return std::string{value_view}; }); -//} -// -//nonstd::expected<void, std::error_code> ConfigurableComponentImpl::setProperty(const std::string_view name, std::string value) { -// const std::lock_guard<std::mutex> lock(configuration_mutex_); -// const auto it = supported_properties_.find(name); -// if (it == supported_properties_.end()) { return nonstd::make_unexpected(PropertyErrorCode::NotSupportedProperty); } -// Property& prop = it->second; -// -// return prop.setValue(std::move(value)); -//} -// -//nonstd::expected<void, std::error_code> ConfigurableComponentImpl::clearProperty(const std::string_view name) { -// const std::lock_guard<std::mutex> lock(configuration_mutex_); -// const auto it = supported_properties_.find(name); -// if (it == supported_properties_.end()) { return nonstd::make_unexpected(PropertyErrorCode::NotSupportedProperty); } -// Property& prop = it->second; -// -// prop.clearValues(); -// return {}; -//} -// -//nonstd::expected<void, std::error_code> ConfigurableComponentImpl::appendProperty(const std::string_view name, std::string value) { -// const std::lock_guard<std::mutex> lock(configuration_mutex_); -// const auto it = supported_properties_.find(name); -// if (it == supported_properties_.end()) { return nonstd::make_unexpected(PropertyErrorCode::NotSupportedProperty); } -// Property& prop = it->second; -// -// return prop.appendValue(std::move(value)); -//} -// -//nonstd::expected<std::string, std::error_code> ConfigurableComponentImpl::getDynamicProperty(const std::string_view name) const { -// const std::lock_guard<std::mutex> lock(configuration_mutex_); -// if (!supportsDynamicProperties()) { -// return nonstd::make_unexpected(PropertyErrorCode::DynamicPropertiesNotSupported); -// } -// const auto it = dynamic_properties_.find(name); -// if (it == dynamic_properties_.end()) { return nonstd::make_unexpected(PropertyErrorCode::PropertyNotSet); } -// const Property& prop = it->second; -// return prop.getValue() | utils::transform([](const std::string_view value_view) -> std::string { return std::string{value_view}; }); -//} -// -//nonstd::expected<void, std::error_code> ConfigurableComponentImpl::setDynamicProperty(std::string name, std::string value) { -// const std::lock_guard<std::mutex> lock(configuration_mutex_); -// if (!supportsDynamicProperties()) { -// return nonstd::make_unexpected(PropertyErrorCode::DynamicPropertiesNotSupported); -// } -// Property& prop = dynamic_properties_[std::move(name)]; -// return prop.setValue(std::move(value)); -//} -// -//nonstd::expected<void, std::error_code> ConfigurableComponentImpl::appendDynamicProperty(const std::string_view name, std::string value) { -// const std::lock_guard<std::mutex> lock(configuration_mutex_); -// if (!supportsDynamicProperties()) { -// return nonstd::make_unexpected(PropertyErrorCode::DynamicPropertiesNotSupported); -// } -// Property& prop = dynamic_properties_[std::string{name}]; -// return prop.appendValue(std::move(value)); -//} -// -//std::vector<std::string> ConfigurableComponentImpl::getDynamicPropertyKeys() const { -// std::lock_guard<std::mutex> lock(configuration_mutex_); -// -// return dynamic_properties_ | ranges::views::transform([](const auto& kv) { return kv.first; }) | ranges::to<std::vector>(); -//} -// -//std::map<std::string, std::string> ConfigurableComponentImpl::getDynamicProperties() const { -// std::lock_guard<std::mutex> lock(configuration_mutex_); -// std::map<std::string, std::string> result; -// for(const auto& [key,value]: dynamic_properties_) { -// result[key] = value.getValue().value_or(""); -// } -// return result; -//} -// -//nonstd::expected<PropertyReference, std::error_code> ConfigurableComponentImpl::getPropertyReference(const std::string_view name) const { -// const auto it = supported_properties_.find(name); -// if (it == supported_properties_.end()) { return nonstd::make_unexpected(PropertyErrorCode::NotSupportedProperty); } -// const Property& prop = it->second; -// return prop.getReference(); -//} -// -//[[nodiscard]] nonstd::expected<std::vector<std::string>, std::error_code> ConfigurableComponentImpl::getAllPropertyValues(const std::string_view name) const { -// std::lock_guard<std::mutex> lock(configuration_mutex_); -// -// const auto it = supported_properties_.find(name); -// if (it == supported_properties_.end()) { return nonstd::make_unexpected(PropertyErrorCode::NotSupportedProperty); } -// const Property& prop = it->second; -// return prop.getAllValues() | utils::transform([](const auto& values) -> std::vector<std::string> { return std::vector<std::string>{values.begin(), values.end()}; }); -//} -// -//[[nodiscard]] nonstd::expected<std::vector<std::string>, std::error_code> ConfigurableComponentImpl::getAllDynamicPropertyValues(const std::string_view name) const { -// std::lock_guard<std::mutex> lock(configuration_mutex_); -// -// const auto it = dynamic_properties_.find(name); -// if (it == dynamic_properties_.end()) { return nonstd::make_unexpected(PropertyErrorCode::PropertyNotSet); } -// const Property& prop = it->second; -// return prop.getAllValues() | utils::transform([](const auto& values) -> std::vector<std::string> { return std::vector<std::string>{values.begin(), values.end()}; }); -//} -// -//[[nodiscard]] std::map<std::string, Property> ConfigurableComponentImpl::getSupportedProperties() const { -// std::lock_guard<std::mutex> lock(configuration_mutex_); -// std::map<std::string, Property> supported_properties; -// for (const auto& [name, prop]: supported_properties_) { -// supported_properties.emplace(name, prop); -// } -// return supported_properties; -// -//} -// -//} // namespace org::apache::nifi::minifi::core diff --git a/libminifi/src/core/Connectable.cpp b/libminifi/src/core/Connectable.cpp deleted file mode 100644 index 5fe3f9f07..000000000 --- a/libminifi/src/core/Connectable.cpp +++ /dev/null @@ -1,173 +0,0 @@ -///** -// * -// * Licensed to the Apache Software Foundation (ASF) under one or more -// * contributor license agreements. See the NOTICE file distributed with -// * this work for additional information regarding copyright ownership. -// * The ASF licenses this file to You under the Apache License, Version 2.0 -// * (the "License"); you may not use this file except in compliance with -// * the License. You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ -//#include "core/ConnectableImpl.h" -//#include <utility> -//#include <memory> -//#include <string> -//#include <set> -//#include "core/logging/LoggerFactory.h" -// -//namespace org::apache::nifi::minifi::core { -// -//ConnectableImpl::ConnectableImpl(const std::string_view name, const utils::Identifier &uuid) -// : CoreComponentImpl(name, uuid), -// max_concurrent_tasks_(1), -// connectable_version_(nullptr), -// logger_(logging::LoggerFactory<Connectable>::getLogger(uuid_)) { -//} -// -//ConnectableImpl::ConnectableImpl(const std::string_view name) -// : CoreComponentImpl(name), -// max_concurrent_tasks_(1), -// connectable_version_(nullptr), -// logger_(logging::LoggerFactory<Connectable>::getLogger(uuid_)) { -//} -// -//ConnectableImpl::~ConnectableImpl() = default; -// -//void ConnectableImpl::setSupportedRelationships(std::span<const core::RelationshipDefinition> relationships) { -// if (isRunning()) { -// logger_->log_warn("Cannot set processor supported relationship while the process {} is running", name_); -// return; -// } -// -// std::lock_guard<std::mutex> lock(relationship_mutex_); -// -// relationships_.clear(); -// for (const auto& item : relationships) { -// relationships_.emplace(item.name, item); -// logger_->log_debug("Processor {} supported relationship name {}", name_, item.name); -// } -//} -// -//std::vector<Relationship> ConnectableImpl::getSupportedRelationships() const { -// std::vector<Relationship> relationships; -// relationships.reserve(relationships_.size()); -// for (auto const &item : relationships_) { -// relationships.push_back(item.second); -// } -// return relationships; -//} -// -//bool ConnectableImpl::isSupportedRelationship(const core::Relationship &relationship) { -// // if we are running we do not need a lock since the function to change relationships_ ( setSupportedRelationships) -// // cannot be executed while we are running -// const bool isConnectableRunning = isRunning(); -// -// const auto conditionalLock = isConnectableRunning ? std::unique_lock<std::mutex>() : std::unique_lock<std::mutex>(relationship_mutex_); -// -// return relationships_.contains(relationship.getName()); -//} -// -//void ConnectableImpl::addAutoTerminatedRelationship(const core::Relationship& relationship) { -// if (isRunning()) { -// logger_->log_warn("Can not add processor auto terminated relationship while the process {} is running", name_); -// return; -// } -// -// std::lock_guard<std::mutex> lock(relationship_mutex_); -// -// auto_terminated_relationships_[relationship.getName()] = relationship; -//} -// -//void ConnectableImpl::setAutoTerminatedRelationships(std::span<const core::Relationship> relationships) { -// if (isRunning()) { -// logger_->log_warn("Can not set processor auto terminated relationship while the process {} is running", name_); -// return; -// } -// -// std::lock_guard<std::mutex> lock(relationship_mutex_); -// -// auto_terminated_relationships_.clear(); -// for (const auto& item : relationships) { -// auto_terminated_relationships_[item.getName()] = item; -// logger_->log_debug("Processor {} auto terminated relationship name {}", name_, item.getName()); -// } -//} -// -//bool ConnectableImpl::isAutoTerminated(const core::Relationship &relationship) { -// // if we are running we do not need a lock since the function to change relationships_ ( setSupportedRelationships) -// // cannot be executed while we are running -// const bool isConnectableRunning = isRunning(); -// -// const auto conditionalLock = isConnectableRunning ? std::unique_lock<std::mutex>() : std::unique_lock<std::mutex>(relationship_mutex_); -// -// return auto_terminated_relationships_.contains(relationship.getName()); -//} -// -//void ConnectableImpl::waitForWork(std::chrono::milliseconds timeout) { -// has_work_.store(isWorkAvailable()); -// -// if (!has_work_.load()) { -// std::unique_lock<std::mutex> lock(work_available_mutex_); -// work_condition_.wait_for(lock, timeout, [&] {return has_work_.load();}); -// } -//} -// -//void ConnectableImpl::notifyWork() { -// // Do nothing if we are not event-driven -// if (strategy_ != EVENT_DRIVEN) { -// return; -// } -// -// { -// has_work_.store(isWorkAvailable()); -// -// if (has_work_.load()) { -// work_condition_.notify_one(); -// } -// } -//} -// -//std::set<Connectable*> ConnectableImpl::getOutGoingConnections(const std::string &relationship) { -// const auto it = outgoing_connections_.find(relationship); -// if (it != outgoing_connections_.end()) { -// return it->second; -// } else if (relationship == "__self__") { -// return {this}; -// } else { -// return {}; -// } -//} -// -//Connectable* ConnectableImpl::getNextIncomingConnection() { -// std::lock_guard<std::mutex> lock(relationship_mutex_); -// return getNextIncomingConnectionImpl(lock); -//} -// -//Connectable* ConnectableImpl::getNextIncomingConnectionImpl(const std::lock_guard<std::mutex>& /*relatioship_mutex_lock*/) { -// if (incoming_connections_.empty()) -// return nullptr; -// -// if (incoming_connections_Iter == incoming_connections_.end()) -// incoming_connections_Iter = incoming_connections_.begin(); -// -// auto ret = *incoming_connections_Iter; -// incoming_connections_Iter++; -// -// if (incoming_connections_Iter == incoming_connections_.end()) -// incoming_connections_Iter = incoming_connections_.begin(); -// -// return ret; -//} -// -//Connectable* ConnectableImpl::pickIncomingConnection() { -// return getNextIncomingConnection(); -//} -// -//} // namespace org::apache::nifi::minifi::core diff --git a/libminifi/src/core/Processor.cpp b/libminifi/src/core/Processor.cpp index a70867ce7..d1188c234 100644 --- a/libminifi/src/core/Processor.cpp +++ b/libminifi/src/core/Processor.cpp @@ -38,7 +38,6 @@ #include "range/v3/algorithm/any_of.hpp" #include "fmt/format.h" #include "Exception.h" -#include "core/Processor.h" #include "core/ProcessorMetrics.h" using namespace std::literals::chrono_literals; diff --git a/libminifi/test/libtest/unit/DummyProcessor.h b/libminifi/test/libtest/unit/DummyProcessor.h index 0e68bdfb2..ba7f7bc08 100644 --- a/libminifi/test/libtest/unit/DummyProcessor.h +++ b/libminifi/test/libtest/unit/DummyProcessor.h @@ -30,7 +30,7 @@ class DummyProcessor : public minifi::core::ProcessorImpl { public: using ProcessorImpl::ProcessorImpl; - DummyProcessor(std::string_view name) + explicit DummyProcessor(std::string_view name) : ProcessorImpl{minifi::core::ProcessorMetadata{ .uuid = minifi::utils::IdGenerator::getIdGenerator()->generate(), .name = std::string{name}, diff --git a/libminifi/test/libtest/unit/ProcessorUtils.h b/libminifi/test/libtest/unit/ProcessorUtils.h index 36a270d9d..dd637c7dd 100644 --- a/libminifi/test/libtest/unit/ProcessorUtils.h +++ b/libminifi/test/libtest/unit/ProcessorUtils.h @@ -43,4 +43,4 @@ std::unique_ptr<core::Processor> make_custom_processor(Args&&... args) { return std::make_unique<core::Processor>(name, uuid, std::move(processor_impl)); } -} // namespace org::apache::nifi::minifi::test::utils \ No newline at end of file +} // namespace org::apache::nifi::minifi::test::utils diff --git a/libminifi/test/libtest/unit/TestBase.h b/libminifi/test/libtest/unit/TestBase.h index 67a155675..8ecef5ab6 100644 --- a/libminifi/test/libtest/unit/TestBase.h +++ b/libminifi/test/libtest/unit/TestBase.h @@ -205,7 +205,7 @@ template<typename T> class TypedProcessorWrapper { public: TypedProcessorWrapper() = default; - TypedProcessorWrapper(core::Processor* proc): proc_(proc) { + TypedProcessorWrapper(core::Processor* proc): proc_(proc) { // NOLINT(runtime/explicit) if (proc_) { proc_->getImpl<T>(); }
