diff --git a/extensions/rocksdb-repos/ProvenanceRepository.h b/extensions/rocksdb-repos/ProvenanceRepository.h index 29d1fd6caf..89b89dbe81 100644 --- a/extensions/rocksdb-repos/ProvenanceRepository.h +++ b/extensions/rocksdb-repos/ProvenanceRepository.h @@ -76,8 +76,6 @@ class ProvenanceRepository : public core::repository::RocksDbRepository { void destroy(); - // Prevent default copy constructor and assignment operation - // Only support pass by reference or pointer ProvenanceRepository(const ProvenanceRepository &parent) = delete; ProvenanceRepository &operator=(const ProvenanceRepository &parent) = delete; diff --git a/libminifi/include/ResourceClaim.h b/libminifi/include/ResourceClaim.h index 8d38a33dc9..6db0048113 100644 --- a/libminifi/include/ResourceClaim.h +++ b/libminifi/include/ResourceClaim.h @@ -90,8 +90,7 @@ class ResourceClaimImpl : public ResourceClaim { private: // Logger std::shared_ptr logger_; - // Prevent default copy constructor and assignment operation - // Only support pass by reference or pointer + ResourceClaimImpl(const ResourceClaimImpl &parent); ResourceClaimImpl &operator=(const ResourceClaimImpl &parent); diff --git a/libminifi/include/core/ProcessGroup.h b/libminifi/include/core/ProcessGroup.h index 579ad89395..bb3b018b7e 100644 --- a/libminifi/include/core/ProcessGroup.h +++ b/libminifi/include/core/ProcessGroup.h @@ -268,8 +268,7 @@ class ProcessGroup : public CoreComponentImpl { mutable std::recursive_mutex mutex_; // Logger std::shared_ptr logger_; - // Prevent default copy constructor and assignment operation - // Only support pass by reference or pointer + ProcessGroup(const ProcessGroup &parent); ProcessGroup &operator=(const ProcessGroup &parent); static std::shared_ptr id_generator_; diff --git a/libminifi/include/core/ProcessSession.h b/libminifi/include/core/ProcessSession.h index 14adb56751..b424acbce4 100644 --- a/libminifi/include/core/ProcessSession.h +++ b/libminifi/include/core/ProcessSession.h @@ -49,29 +49,20 @@ std::string to_string(const ReadBufferResult& read_buffer_result); namespace org::apache::nifi::minifi::core { -// ProcessSession Class class ProcessSessionImpl : public ReferenceContainerImpl, public virtual ProcessSession { public: - // Constructor - /*! - * Create a new process session - */ explicit ProcessSessionImpl(std::shared_ptr processContext); - // Destructor ~ProcessSessionImpl() override; - - // Commit the session void commit() override; - // Roll Back the session void rollback() override; nonstd::expected rollbackNoThrow() noexcept override; - // Get Provenance Report + std::shared_ptr getProvenanceReporter() override { return provenance_report_; } - // writes the created contents to the underlying repository + void flushContent() override; std::shared_ptr get() override; @@ -80,7 +71,7 @@ class ProcessSessionImpl : public ReferenceContainerImpl, public virtual Process void add(const std::shared_ptr &record) override; std::shared_ptr clone(const core::FlowFile& parent) override; std::shared_ptr clone(const core::FlowFile& parent, int64_t offset, int64_t size) override; - // Transfer the FlowFile to the relationship + void transfer(const std::shared_ptr& flow, const Relationship& relationship) override; void transferToCustomRelationship(const std::shared_ptr& flow, const std::string& relationship_name) override; @@ -88,57 +79,44 @@ class ProcessSessionImpl : public ReferenceContainerImpl, public virtual Process void removeAttribute(core::FlowFile& flow, std::string_view key) override; void remove(const std::shared_ptr &flow) override; - // Access the contents of the flow file as an input stream; returns null if the flow file has no content claim + std::shared_ptr getFlowFileContentStream(const core::FlowFile& flow_file) override; - // Execute the given read callback against the content + int64_t read(const std::shared_ptr& flow_file, const io::InputStreamCallback& callback) override; int64_t read(const core::FlowFile& flow_file, const io::InputStreamCallback& callback) override; - // Read content into buffer + detail::ReadBufferResult readBuffer(const std::shared_ptr& flow) override; - // Execute the given write callback against the content + void write(const std::shared_ptr &flow, const io::OutputStreamCallback& callback) override; void write(core::FlowFile& flow, const io::OutputStreamCallback& callback) override; // Read and write the flow file at the same time (eg. for processing it line by line) int64_t readWrite(const std::shared_ptr &flow, const io::InputOutputStreamCallback& callback) override; - // Replace content with buffer + void writeBuffer(const std::shared_ptr& flow_file, std::span buffer) override; void writeBuffer(const std::shared_ptr& flow_file, std::span buffer) override; - // Execute the given write/append callback against the content + void append(const std::shared_ptr &flow, const io::OutputStreamCallback& callback) override; - // Append buffer to content + void appendBuffer(const std::shared_ptr& flow, std::span buffer) override; void appendBuffer(const std::shared_ptr& flow, std::span buffer) override; - // Penalize the flow + void penalize(const std::shared_ptr &flow) override; bool outgoingConnectionsFull(const std::string& relationship) override; - /** - * Imports a file from the data stream - * @param stream incoming data stream that contains the data to store into a file - * @param flow flow file - */ void importFrom(io::InputStream &stream, const std::shared_ptr &flow) override; void importFrom(io::InputStream&& stream, const std::shared_ptr &flow) override; - // import from the data source. void import(const std::string& source, const std::shared_ptr &flow, bool keepSource = true, uint64_t offset = 0) override; - /** - * Exports the data stream to a file - * @param string file to export stream to - * @param flow flow file - * @param bool whether or not to keep the content in the flow file - */ bool exportContent(const std::string &destination, const std::shared_ptr &flow, bool keepContent) override; bool exportContent(const std::string &destination, const std::string &tmpFileName, const std::shared_ptr &flow, bool keepContent) override; - // Stash the content to a key void stash(const std::string &key, const std::shared_ptr &flow) override; - // Restore content previously stashed to a key + void restore(const std::string &key, const std::shared_ptr &flow) override; bool existsFlowFileInRelationship(const Relationship &relationship) override; @@ -149,8 +127,6 @@ class ProcessSessionImpl : public ReferenceContainerImpl, public virtual Process bool hasBeenTransferred(const core::FlowFile &flow) const override; -// Prevent default copy constructor and assignment operation -// Only support pass by reference or pointer ProcessSessionImpl(const ProcessSessionImpl &parent) = delete; ProcessSessionImpl &operator=(const ProcessSessionImpl &parent) = delete; @@ -202,17 +178,11 @@ class ProcessSessionImpl : public ReferenceContainerImpl, public virtual Process void ensureNonNullResourceClaim( const std::map>>& transactionMap); - // Clone the flow file during transfer to multiple connections for a relationship std::shared_ptr cloneDuringTransfer(const core::FlowFile& parent); - // ProcessContext std::shared_ptr process_context_; - // Logger std::shared_ptr logger_; - // Provenance Report std::shared_ptr provenance_report_; - std::shared_ptr content_session_; - StateManager* stateManager_; static std::shared_ptr id_generator_; diff --git a/libminifi/include/core/ProcessSessionFactory.h b/libminifi/include/core/ProcessSessionFactory.h index 2bf57d442e..fae0fb1ed8 100644 --- a/libminifi/include/core/ProcessSessionFactory.h +++ b/libminifi/include/core/ProcessSessionFactory.h @@ -25,40 +25,23 @@ #include "ProcessSession.h" #include "minifi-cpp/core/ProcessSessionFactory.h" -namespace org { -namespace apache { -namespace nifi { -namespace minifi { -namespace core { +namespace org::apache::nifi::minifi::core { -// ProcessSessionFactory Class class ProcessSessionFactoryImpl : public virtual ProcessSessionFactory { public: - // Constructor - /*! - * Create a new process session factory - */ explicit ProcessSessionFactoryImpl(std::shared_ptr processContext) : process_context_(processContext) { } - // Create the session std::shared_ptr createSession() override; - // Prevent default copy constructor and assignment operation - // Only support pass by reference or pointer ProcessSessionFactoryImpl(const ProcessSessionFactoryImpl &parent) = delete; ProcessSessionFactoryImpl &operator=(const ProcessSessionFactoryImpl &parent) = delete; ~ProcessSessionFactoryImpl() override = default; private: - // ProcessContext std::shared_ptr process_context_; }; -} // namespace core -} // namespace minifi -} // namespace nifi -} // namespace apache -} // namespace org +} // namespace org::apache::nifi::minifi::core diff --git a/libminifi/include/core/WeakReference.h b/libminifi/include/core/WeakReference.h index f28f557d3d..be7a27bc6b 100644 --- a/libminifi/include/core/WeakReference.h +++ b/libminifi/include/core/WeakReference.h @@ -25,11 +25,7 @@ #include "minifi-cpp/core/WeakReference.h" -namespace org { -namespace apache { -namespace nifi { -namespace minifi { -namespace core { +namespace org::apache::nifi::minifi::core { /** * Reference container is a vector of weak references that enables @@ -69,8 +65,4 @@ class ReferenceContainerImpl : public virtual ReferenceContainer { std::vector > references; }; -} // namespace core -} // namespace minifi -} // namespace nifi -} // namespace apache -} // namespace org +} // namespace org::apache::nifi::minifi::core diff --git a/libminifi/include/core/controller/ControllerServiceNode.h b/libminifi/include/core/controller/ControllerServiceNode.h index af29525462..bb09b2644d 100644 --- a/libminifi/include/core/controller/ControllerServiceNode.h +++ b/libminifi/include/core/controller/ControllerServiceNode.h @@ -37,12 +37,6 @@ namespace org::apache::nifi::minifi::core::controller { class ControllerServiceNodeImpl : public CoreComponentImpl, public ConfigurableComponentImpl, public virtual ControllerServiceNode { public: - /** - * Constructor for the controller service node. - * @param service controller service reference - * @param id identifier for this node. - * @param configuration shared pointer configuration. - */ explicit ControllerServiceNodeImpl(std::shared_ptr service, std::string id, std::shared_ptr configuration) : CoreComponentImpl(std::move(id)), active(false), @@ -105,9 +99,7 @@ class ControllerServiceNodeImpl : public CoreComponentImpl, public ConfigurableC std::atomic active; std::shared_ptr configuration_; - // controller service. std::shared_ptr controller_service_; - // linked controller services. std::vector linked_controller_services_; }; diff --git a/libminifi/include/core/state/FlowIdentifier.h b/libminifi/include/core/state/FlowIdentifier.h index 5df4563ed8..61fe6d79b9 100644 --- a/libminifi/include/core/state/FlowIdentifier.h +++ b/libminifi/include/core/state/FlowIdentifier.h @@ -21,11 +21,7 @@ #include "minifi-cpp/core/state/FlowIdentifier.h" -namespace org { -namespace apache { -namespace nifi { -namespace minifi { -namespace state { +namespace org::apache::nifi::minifi::state { /** * Purpose: Represents a flow identifier for a given flow update or instance. @@ -36,9 +32,6 @@ class FlowIdentifierImpl : public virtual FlowIdentifier { public: FlowIdentifierImpl() = delete; - /** - * Constructor accepts the url, bucket id, and flow id. - */ explicit FlowIdentifierImpl(const std::string &url, const std::string &bucket_id, const std::string &flow_id) { registry_url_ = url; bucket_id_ = bucket_id; @@ -74,8 +67,4 @@ class FlowIdentifierImpl : public virtual FlowIdentifier { }; -} // namespace state -} // namespace minifi -} // namespace nifi -} // namespace apache -} // namespace org +} // namespace org::apache::nifi::minifi::state diff --git a/libminifi/include/core/state/nodes/MetricsBase.h b/libminifi/include/core/state/nodes/MetricsBase.h index 2bbc0267b8..98a1c260c4 100644 --- a/libminifi/include/core/state/nodes/MetricsBase.h +++ b/libminifi/include/core/state/nodes/MetricsBase.h @@ -33,9 +33,6 @@ namespace org::apache::nifi::minifi::state::response { -/** - * Purpose: Defines a metric that - */ class DeviceInformation : public ResponseNodeImpl { public: DeviceInformation(std::string_view name, const utils::Identifier& uuid) @@ -47,9 +44,6 @@ class DeviceInformation : public ResponseNodeImpl { } }; -/** - * Purpose: Defines a metric that - */ class ObjectNode : public ResponseNodeImpl { public: explicit ObjectNode(const std::string_view name, const utils::Identifier& uuid = {}) diff --git a/libminifi/include/properties/Properties.h b/libminifi/include/properties/Properties.h index 87a7784726..2cab983ae5 100644 --- a/libminifi/include/properties/Properties.h +++ b/libminifi/include/properties/Properties.h @@ -49,7 +49,6 @@ class PropertiesImpl : public virtual Properties { return name_; } - // Clear the load config void clear() override { std::lock_guard lock(mutex_); properties_.clear(); @@ -57,7 +56,6 @@ class PropertiesImpl : public virtual Properties { void set(const std::string& key, const std::string& value) override { set(key, value, PropertyChangeLifetime::PERSISTENT); } - // Set the config value void set(const std::string &key, const std::string &value, PropertyChangeLifetime lifetime) override { auto active_value = utils::string::replaceEnvironmentVariables(value); std::lock_guard lock(mutex_); @@ -78,7 +76,6 @@ class PropertiesImpl : public virtual Properties { dirty_ = true; } } - // Check whether the config value existed bool has(const std::string& key) const override { std::lock_guard lock(mutex_); return properties_.count(key) > 0; @@ -148,7 +145,6 @@ class PropertiesImpl : public virtual Properties { // Mutex for protection mutable std::mutex mutex_; - // Logger std::shared_ptr logger_; // Home location for this executable std::filesystem::path minifi_home_; diff --git a/libminifi/include/provenance/Provenance.h b/libminifi/include/provenance/Provenance.h index 41eb61674e..01e3c3fbe2 100644 --- a/libminifi/include/provenance/Provenance.h +++ b/libminifi/include/provenance/Provenance.h @@ -264,8 +264,6 @@ class ProvenanceEventRecordImpl : public core::SerializableComponentImpl, public std::string _alternateIdentifierUri; private: - // Prevent default copy constructor and assignment operation - // Only support pass by reference or pointer ProvenanceEventRecordImpl(const ProvenanceEventRecordImpl &parent); ProvenanceEventRecordImpl &operator=(const ProvenanceEventRecordImpl &parent); static std::shared_ptr logger_; @@ -337,8 +335,6 @@ class ProvenanceReporterImpl : public virtual ProvenanceReporter { std::set> _events; std::shared_ptr repo_; - // Prevent default copy constructor and assignment operation - // Only support pass by reference or pointer ProvenanceReporterImpl(const ProvenanceReporterImpl &parent); ProvenanceReporterImpl &operator=(const ProvenanceReporterImpl &parent); }; diff --git a/libminifi/include/sitetosite/HTTPProtocol.h b/libminifi/include/sitetosite/HTTPProtocol.h index 769275870d..342078d298 100644 --- a/libminifi/include/sitetosite/HTTPProtocol.h +++ b/libminifi/include/sitetosite/HTTPProtocol.h @@ -148,8 +148,7 @@ class HttpSiteToSiteClient : public sitetosite::SiteToSiteClient { private: sitetosite::RespondCode current_code; std::shared_ptr logger_ = core::logging::LoggerFactory::getLogger(); - // Prevent default copy constructor and assignment operation - // Only support pass by reference or pointer + HttpSiteToSiteClient(const HttpSiteToSiteClient &parent); HttpSiteToSiteClient &operator=(const HttpSiteToSiteClient &parent); static std::shared_ptr id_generator_; diff --git a/libminifi/include/sitetosite/RawSocketProtocol.h b/libminifi/include/sitetosite/RawSocketProtocol.h index 09baec6882..2bee3b3115 100644 --- a/libminifi/include/sitetosite/RawSocketProtocol.h +++ b/libminifi/include/sitetosite/RawSocketProtocol.h @@ -169,8 +169,6 @@ class RawSiteToSiteClient : public sitetosite::SiteToSiteClient { // commsIdentifier utils::Identifier _commsIdentifier; - // Prevent default copy constructor and assignment operation - // Only support pass by reference or pointer RawSiteToSiteClient(const RawSiteToSiteClient &parent); RawSiteToSiteClient &operator=(const RawSiteToSiteClient &parent); static std::shared_ptr id_generator_; diff --git a/libminifi/src/core/ProcessSession.cpp b/libminifi/src/core/ProcessSession.cpp index 234af33ce8..30068310ef 100644 --- a/libminifi/src/core/ProcessSession.cpp +++ b/libminifi/src/core/ProcessSession.cpp @@ -785,8 +785,8 @@ void ProcessSessionImpl::commit() { if (metrics_) { for (const auto& [relationship_name, transfer_metrics] : transfers) { - metrics_->transferred_bytes() += transfer_metrics.transfer_size; - metrics_->transferred_flow_files() += transfer_metrics.transfer_count; + metrics_->transferredBytes() += transfer_metrics.transfer_size; + metrics_->transferredFlowFiles() += transfer_metrics.transfer_count; metrics_->increaseRelationshipTransferCount(relationship_name, transfer_metrics.transfer_count); } } diff --git a/libminifi/test/flow-tests/FlowControllerTests.cpp b/libminifi/test/flow-tests/FlowControllerTests.cpp index abba35d2ee..5771e41f70 100644 --- a/libminifi/test/flow-tests/FlowControllerTests.cpp +++ b/libminifi/test/flow-tests/FlowControllerTests.cpp @@ -110,6 +110,7 @@ TEST_CASE("Flow shutdown drains connections", "[TestFlow1]") { testController.configuration_->set(minifi::Configure::nifi_flowcontroller_drain_timeout, "100 ms"); auto sinkProc = dynamic_cast(root->findProcessorByName("TestProcessor")); + gsl_Assert(sinkProc); // prevent execution of the consumer processor sinkProc->yield(10s); diff --git a/libminifi/test/flow-tests/LoopTest.cpp b/libminifi/test/flow-tests/LoopTest.cpp index 48d62b5cab..e46aaa2f67 100644 --- a/libminifi/test/flow-tests/LoopTest.cpp +++ b/libminifi/test/flow-tests/LoopTest.cpp @@ -90,7 +90,9 @@ TEST_CASE("Flow with a single loop", "[SingleLoopFlow]") { auto root = testController.root_; auto procGenerator = dynamic_cast(root->findProcessorByName("Generator")); + gsl_Assert(procGenerator); auto procA = dynamic_cast(root->findProcessorByName("A")); + gsl_Assert(procA); int tryCount = 0; // wait for the procA to get triggered 15 times diff --git a/libminifi/test/flow-tests/MultiLoopTest.cpp b/libminifi/test/flow-tests/MultiLoopTest.cpp index e11183decc..28aed161ea 100644 --- a/libminifi/test/flow-tests/MultiLoopTest.cpp +++ b/libminifi/test/flow-tests/MultiLoopTest.cpp @@ -99,7 +99,9 @@ TEST_CASE("Flow with two loops", "[MultiLoopFlow]") { auto root = testController.root_; auto procGenerator = dynamic_cast(root->findProcessorByName("Generator")); + gsl_Assert(procGenerator); auto procA = dynamic_cast(root->findProcessorByName("A")); + gsl_Assert(procA); int tryCount = 0; while (tryCount++ < 10 && procA->trigger_count.load() <= 15) { diff --git a/libminifi/test/schema-tests/SchemaTests.cpp b/libminifi/test/schema-tests/SchemaTests.cpp index a2700fe179..3a3f7dc58f 100644 --- a/libminifi/test/schema-tests/SchemaTests.cpp +++ b/libminifi/test/schema-tests/SchemaTests.cpp @@ -132,7 +132,6 @@ TEST_CASE("The generated JSON schema matches a valid json flow") { } TEST_CASE("The JSON schema detects invalid values in the json flow") { - std::ofstream{"/Users/adebreceni/work/minifi-homes/json-schema-test/schema.json"} << minifi::docs::generateJsonSchema(); const nlohmann::json config_schema = nlohmann::json::parse(minifi::docs::generateJsonSchema()); nlohmann::json_schema::json_validator validator; diff --git a/minifi-api/include/minifi-cpp/core/FlowFile.h b/minifi-api/include/minifi-cpp/core/FlowFile.h index 9bdb5e7343..2e20ad314d 100644 --- a/minifi-api/include/minifi-cpp/core/FlowFile.h +++ b/minifi-api/include/minifi-cpp/core/FlowFile.h @@ -81,25 +81,15 @@ class FlowFile : public virtual CoreComponent, public virtual ReferenceContainer static std::shared_ptr create(); }; -// FlowFile Attribute struct SpecialFlowAttribute { - // The flowfile's path indicates the relative directory to which a FlowFile belongs and does not contain the filename MINIFIAPI static constexpr std::string_view PATH = "path"; - // The flowfile's absolute path indicates the absolute directory to which a FlowFile belongs and does not contain the filename MINIFIAPI static constexpr std::string_view ABSOLUTE_PATH = "absolute.path"; - // The filename of the FlowFile. The filename should not contain any directory structure. MINIFIAPI static constexpr std::string_view FILENAME = "filename"; - // A unique UUID assigned to this FlowFile. MINIFIAPI static constexpr std::string_view UUID = "uuid"; - // A numeric value indicating the FlowFile priority MINIFIAPI static constexpr std::string_view priority = "priority"; - // The MIME Type of this FlowFile MINIFIAPI static constexpr std::string_view MIME_TYPE = "mime.type"; - // Specifies the reason that a FlowFile is being discarded MINIFIAPI static constexpr std::string_view DISCARD_REASON = "discard.reason"; - // Indicates an identifier other than the FlowFile's UUID that is known to refer to this FlowFile. MINIFIAPI static constexpr std::string_view ALTERNATE_IDENTIFIER = "alternate.identifier"; - // Flow identifier MINIFIAPI static constexpr std::string_view FLOW_ID = "flow.id"; static constexpr std::array getSpecialFlowAttributes() { diff --git a/minifi-api/include/minifi-cpp/core/ObjectFactory.h b/minifi-api/include/minifi-cpp/core/ObjectFactory.h index 9230a50c53..9f247b2a2a 100644 --- a/minifi-api/include/minifi-cpp/core/ObjectFactory.h +++ b/minifi-api/include/minifi-cpp/core/ObjectFactory.h @@ -22,16 +22,8 @@ #include #include "Core.h" -namespace org { -namespace apache { -namespace nifi { -namespace minifi { -namespace core { +namespace org::apache::nifi::minifi::core { -/** - * Factory that is used as an interface for - * creating processors from shared objects. - */ class ObjectFactory { public: virtual std::unique_ptr create(const std::string& /*name*/) = 0; @@ -44,8 +36,4 @@ class ObjectFactory { virtual ~ObjectFactory() = default; }; -} // namespace core -} // namespace minifi -} // namespace nifi -} // namespace apache -} // namespace org +} // namespace org::apache::nifi::minifi::core diff --git a/minifi-api/include/minifi-cpp/core/ProcessContext.h b/minifi-api/include/minifi-cpp/core/ProcessContext.h index 70207fcbbe..a7c3027880 100644 --- a/minifi-api/include/minifi-cpp/core/ProcessContext.h +++ b/minifi-api/include/minifi-cpp/core/ProcessContext.h @@ -16,21 +16,14 @@ */ #pragma once -#include -#include -#include -#include #include -#include #include -#include #include -#include #include #include "minifi-cpp/core/Core.h" #include "minifi-cpp/core/ContentRepository.h" -#include "minifi-cpp/core/controller/ControllerServiceLookup.h" +#include "minifi-cpp/core/controller/ControllerService.h" #include "minifi-cpp/core/ProcessorNode.h" #include "minifi-cpp/core/Property.h" #include "minifi-cpp/core/Repository.h" diff --git a/minifi-api/include/minifi-cpp/core/ProcessContextBuilder.h b/minifi-api/include/minifi-cpp/core/ProcessContextBuilder.h index dee31da514..70adfc0c97 100644 --- a/minifi-api/include/minifi-cpp/core/ProcessContextBuilder.h +++ b/minifi-api/include/minifi-cpp/core/ProcessContextBuilder.h @@ -16,24 +16,14 @@ */ #pragma once -#include -#include -#include -#include -#include -#include -#include #include -#include "Property.h" #include "minifi-cpp/core/Core.h" -#include "utils/Id.h" #include "core/ContentRepository.h" #include "minifi-cpp/properties/Configure.h" #include "minifi-cpp/core/controller/ControllerServiceProvider.h" #include "ProcessContext.h" #include "ProcessorNode.h" #include "minifi-cpp/core/Repository.h" -#include "VariableRegistry.h" namespace org::apache::nifi::minifi::core { /** diff --git a/minifi-api/include/minifi-cpp/core/ProcessSession.h b/minifi-api/include/minifi-cpp/core/ProcessSession.h index 6bd971813f..e19af3b188 100644 --- a/minifi-api/include/minifi-cpp/core/ProcessSession.h +++ b/minifi-api/include/minifi-cpp/core/ProcessSession.h @@ -19,23 +19,10 @@ #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ProcessContext.h" -#include "core/logging/LoggerFactory.h" + #include "FlowFile.h" -#include "WeakReference.h" #include "minifi-cpp/provenance/Provenance.h" -#include "utils/gsl.h" #include "ProcessorMetrics.h" #include "minifi-cpp/io/StreamCallback.h" diff --git a/minifi-api/include/minifi-cpp/core/ProcessSessionFactory.h b/minifi-api/include/minifi-cpp/core/ProcessSessionFactory.h index d2ede7ceb5..f12f547dc5 100644 --- a/minifi-api/include/minifi-cpp/core/ProcessSessionFactory.h +++ b/minifi-api/include/minifi-cpp/core/ProcessSessionFactory.h @@ -22,24 +22,14 @@ #include -#include "ProcessContext.h" #include "ProcessSession.h" -namespace org { -namespace apache { -namespace nifi { -namespace minifi { -namespace core { +namespace org::apache::nifi::minifi::core { -// ProcessSessionFactory Class class ProcessSessionFactory { public: virtual std::shared_ptr createSession() = 0; virtual ~ProcessSessionFactory() = default; }; -} // namespace core -} // namespace minifi -} // namespace nifi -} // namespace apache -} // namespace org +} // namespace org::apache::nifi::minifi::core diff --git a/minifi-api/include/minifi-cpp/core/Processor.h b/minifi-api/include/minifi-cpp/core/Processor.h index 54bb8c0a38..092df14261 100644 --- a/minifi-api/include/minifi-cpp/core/Processor.h +++ b/minifi-api/include/minifi-cpp/core/Processor.h @@ -16,29 +16,17 @@ */ #pragma once -#include - -#include -#include #include -#include -#include #include #include #include -#include #include #include -#include -#include #include "ConfigurableComponent.h" #include "Connectable.h" -#include "Core.h" #include "minifi-cpp/core/Annotation.h" -#include "DynamicProperty.h" #include "Scheduling.h" -#include "utils/TimeUtil.h" #include "minifi-cpp/core/state/nodes/MetricsBase.h" #include "ProcessorMetrics.h" #include "utils/gsl.h" diff --git a/minifi-api/include/minifi-cpp/core/ProcessorConfig.h b/minifi-api/include/minifi-cpp/core/ProcessorConfig.h index 04d3761d45..0a943ed1a1 100644 --- a/minifi-api/include/minifi-cpp/core/ProcessorConfig.h +++ b/minifi-api/include/minifi-cpp/core/ProcessorConfig.h @@ -14,21 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef LIBMINIFI_INCLUDE_CORE_PROCESSORCONFIG_H_ -#define LIBMINIFI_INCLUDE_CORE_PROCESSORCONFIG_H_ +#pragma once +#include #include #include -#include "Core.h" #include "Property.h" -namespace org { -namespace apache { -namespace nifi { -namespace minifi { -namespace core { - +namespace org::apache::nifi::minifi::core { constexpr const char* DEFAULT_SCHEDULING_STRATEGY{"TIMER_DRIVEN"}; constexpr const char* DEFAULT_SCHEDULING_PERIOD_STR{"1 sec"}; @@ -53,10 +47,4 @@ struct ProcessorConfig { std::string parameterContextName; }; -} // namespace core -} // namespace minifi -} // namespace nifi -} // namespace apache -} // namespace org - -#endif // LIBMINIFI_INCLUDE_CORE_PROCESSORCONFIG_H_ +} // namespace org::apache::nifi::minifi::core diff --git a/minifi-api/include/minifi-cpp/core/ProcessorMetrics.h b/minifi-api/include/minifi-cpp/core/ProcessorMetrics.h index de2bdc97fd..b1e1dda43a 100644 --- a/minifi-api/include/minifi-cpp/core/ProcessorMetrics.h +++ b/minifi-api/include/minifi-cpp/core/ProcessorMetrics.h @@ -19,12 +19,8 @@ #include #include #include -#include -#include -#include #include "minifi-cpp/core/state/nodes/MetricsBase.h" -#include "minifi-cpp/core/state/PublishedMetricProvider.h" namespace org::apache::nifi::minifi::core { @@ -40,12 +36,12 @@ class ProcessorMetrics : public virtual state::response::ResponseNode { virtual void addLastSessionCommitRuntime(std::chrono::milliseconds runtime) = 0; virtual std::atomic& iterations() = 0; - virtual std::atomic& transferred_flow_files() = 0; - virtual std::atomic& transferred_bytes() = 0; + virtual std::atomic& transferredFlowFiles() = 0; + virtual std::atomic& transferredBytes() = 0; virtual const std::atomic& iterations() const = 0; - virtual const std::atomic& transferred_flow_files() const = 0; - virtual const std::atomic& transferred_bytes() const = 0; + virtual const std::atomic& transferredFlowFiles() const = 0; + virtual const std::atomic& transferredBytes() const = 0; }; } // namespace org::apache::nifi::minifi::core diff --git a/minifi-api/include/minifi-cpp/core/ProcessorNode.h b/minifi-api/include/minifi-cpp/core/ProcessorNode.h index f0a16d5608..06d63f1758 100644 --- a/minifi-api/include/minifi-cpp/core/ProcessorNode.h +++ b/minifi-api/include/minifi-cpp/core/ProcessorNode.h @@ -29,9 +29,6 @@ namespace org::apache::nifi::minifi::core { -/** - * Processor node functions as a pass through to the implementing Connectables - */ class ProcessorNode : public virtual ConfigurableComponent, public virtual Connectable { public: virtual Connectable* getProcessor() const = 0; diff --git a/minifi-api/include/minifi-cpp/core/Property.h b/minifi-api/include/minifi-cpp/core/Property.h index b840cb72a2..8307747a3e 100644 --- a/minifi-api/include/minifi-cpp/core/Property.h +++ b/minifi-api/include/minifi-cpp/core/Property.h @@ -120,14 +120,11 @@ class Property { void setAllowedValues(gsl::span allowed_values, const core::PropertyParser& property_parser); - /** - * Add value to the collection of values. - */ void addValue(const std::string &value); Property &operator=(const Property &other) = default; Property &operator=(Property &&other) = default; -// Compare - bool operator <(const Property & right) const; + + bool operator<(const Property & right) const; static bool StringToPermissions(const std::string& input, uint32_t& output) { uint32_t temp = 0U; @@ -169,7 +166,6 @@ class Property { return true; } - // Convert String to Integer template static bool StringToInt(std::string input, T &output); @@ -177,7 +173,6 @@ class Property { return StringToInt(input, output); } -// Convert String to Integer static bool StringToInt(std::string input, uint64_t &output) { return StringToInt(input, output); } @@ -186,15 +181,11 @@ class Property { return StringToInt(input, output); } -// Convert String to Integer static bool StringToInt(std::string input, uint32_t &output) { return StringToInt(input, output); } protected: - /** - * Coerce default values at construction. - */ PropertyValue coerceDefaultValue(const std::string &value); std::string name_; diff --git a/minifi-api/include/minifi-cpp/core/Repository.h b/minifi-api/include/minifi-cpp/core/Repository.h index 763a0b4a0e..9754d23247 100644 --- a/minifi-api/include/minifi-cpp/core/Repository.h +++ b/minifi-api/include/minifi-cpp/core/Repository.h @@ -19,33 +19,19 @@ */ #pragma once -#include #include -#include #include #include -#include #include -#include -#include #include -#include "minifi-cpp/ResourceClaim.h" #include "Connectable.h" #include "ContentRepository.h" -#include "Property.h" #include "SerializableComponent.h" -#include "core/logging/LoggerFactory.h" #include "RepositoryMetricsSource.h" #include "minifi-cpp/properties/Configure.h" -#include "utils/BackTrace.h" -#include "minifi-cpp/SwapManager.h" #include "core/Core.h" -#ifndef WIN32 -#include -#endif - namespace org::apache::nifi::minifi::core { class Repository : public virtual core::CoreComponent, public virtual core::RepositoryMetricsSource { diff --git a/minifi-api/include/minifi-cpp/core/Scheduling.h b/minifi-api/include/minifi-cpp/core/Scheduling.h index 9a46b6cb7b..34b68e9b8d 100644 --- a/minifi-api/include/minifi-cpp/core/Scheduling.h +++ b/minifi-api/include/minifi-cpp/core/Scheduling.h @@ -15,14 +15,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef LIBMINIFI_INCLUDE_CORE_SCHEDULING_H_ -#define LIBMINIFI_INCLUDE_CORE_SCHEDULING_H_ +#pragma once -namespace org { -namespace apache { -namespace nifi { -namespace minifi { -namespace core { +namespace org::apache::nifi::minifi::core { /* * Indicates the valid values for the state of a entity @@ -49,9 +44,4 @@ enum SchedulingStrategy { CRON_DRIVEN }; -} // namespace core -} // namespace minifi -} // namespace nifi -} // namespace apache -} // namespace org -#endif // LIBMINIFI_INCLUDE_CORE_SCHEDULING_H_ +} // namespace org::apache::nifi::minifi::core diff --git a/minifi-api/include/minifi-cpp/core/WeakReference.h b/minifi-api/include/minifi-cpp/core/WeakReference.h index 3b5ecb402d..70cda61a6d 100644 --- a/minifi-api/include/minifi-cpp/core/WeakReference.h +++ b/minifi-api/include/minifi-cpp/core/WeakReference.h @@ -18,16 +18,10 @@ #pragma once +#include #include -#include -#include - -namespace org { -namespace apache { -namespace nifi { -namespace minifi { -namespace core { +namespace org::apache::nifi::minifi::core { /* * An homage to weak references in java, this acts as a class @@ -55,8 +49,4 @@ class ReferenceContainer { virtual void removeReferences() = 0; }; -} // namespace core -} // namespace minifi -} // namespace nifi -} // namespace apache -} // namespace org +} // namespace org::apache::nifi::minifi::core diff --git a/minifi-api/include/minifi-cpp/core/controller/ControllerService.h b/minifi-api/include/minifi-cpp/core/controller/ControllerService.h index 471eaa3f9c..3260757165 100644 --- a/minifi-api/include/minifi-cpp/core/controller/ControllerService.h +++ b/minifi-api/include/minifi-cpp/core/controller/ControllerService.h @@ -23,28 +23,15 @@ #include #include "minifi-cpp/properties/Configure.h" -#include "minifi-cpp/core/Core.h" #include "minifi-cpp/core/ConfigurableComponent.h" #include "minifi-cpp/core/Connectable.h" namespace org::apache::nifi::minifi::core::controller { enum ControllerServiceState { - /** - * Controller Service is disabled and cannot be used. - */ DISABLED, - /** - * Controller Service is in the process of being disabled. - */ DISABLING, - /** - * Controller Service is being enabled. - */ ENABLING, - /** - * Controller Service is enabled. - */ ENABLED }; diff --git a/minifi-api/include/minifi-cpp/core/controller/ControllerServiceLookup.h b/minifi-api/include/minifi-cpp/core/controller/ControllerServiceLookup.h index 64ea9525ee..89d13baa1f 100644 --- a/minifi-api/include/minifi-cpp/core/controller/ControllerServiceLookup.h +++ b/minifi-api/include/minifi-cpp/core/controller/ControllerServiceLookup.h @@ -15,8 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef LIBMINIFI_INCLUDE_CORE_CONTROLLER_CONTROLLERSERVICELOOKUP_H_ -#define LIBMINIFI_INCLUDE_CORE_CONTROLLER_CONTROLLERSERVICELOOKUP_H_ +#pragma once #include #include @@ -25,12 +24,7 @@ #include "minifi-cpp/core/ConfigurableComponent.h" #include "ControllerService.h" -namespace org { -namespace apache { -namespace nifi { -namespace minifi { -namespace core { -namespace controller { +namespace org::apache::nifi::minifi::core::controller { /** * Controller Service Lookup pure virtual class. @@ -82,11 +76,4 @@ class ControllerServiceLookup { virtual const std::string getControllerServiceName(const std::string &identifier) const = 0; }; -} // namespace controller -} // namespace core -} // namespace minifi -} // namespace nifi -} // namespace apache -} // namespace org - -#endif // LIBMINIFI_INCLUDE_CORE_CONTROLLER_CONTROLLERSERVICELOOKUP_H_ +} // namespace org::apache::nifi::minifi::core::controller diff --git a/minifi-api/include/minifi-cpp/core/extension/ExtensionManager.h b/minifi-api/include/minifi-cpp/core/extension/ExtensionManager.h index 38a6e94ff1..63936f1d7f 100644 --- a/minifi-api/include/minifi-cpp/core/extension/ExtensionManager.h +++ b/minifi-api/include/minifi-cpp/core/extension/ExtensionManager.h @@ -17,10 +17,6 @@ #pragma once -#include -#include -#include - #include "Extension.h" namespace org::apache::nifi::minifi::core::extension { diff --git a/minifi-api/include/minifi-cpp/core/state/FlowIdentifier.h b/minifi-api/include/minifi-cpp/core/state/FlowIdentifier.h index 6e61f789f4..ebb7a9312b 100644 --- a/minifi-api/include/minifi-cpp/core/state/FlowIdentifier.h +++ b/minifi-api/include/minifi-cpp/core/state/FlowIdentifier.h @@ -20,12 +20,7 @@ #include - -namespace org { -namespace apache { -namespace nifi { -namespace minifi { -namespace state { +namespace org::apache::nifi::minifi::state { /** * Purpose: Represents a flow identifier for a given flow update or instance. @@ -41,8 +36,4 @@ class FlowIdentifier { }; -} // namespace state -} // namespace minifi -} // namespace nifi -} // namespace apache -} // namespace org +} // namespace org::apache::nifi::minifi::state diff --git a/minifi-api/include/minifi-cpp/core/state/nodes/MetricsBase.h b/minifi-api/include/minifi-cpp/core/state/nodes/MetricsBase.h index 21f20e8505..08fccb2490 100644 --- a/minifi-api/include/minifi-cpp/core/state/nodes/MetricsBase.h +++ b/minifi-api/include/minifi-cpp/core/state/nodes/MetricsBase.h @@ -22,7 +22,6 @@ #include #include #include -#include #include "../Value.h" #include "../PublishedMetricProvider.h" @@ -34,9 +33,6 @@ namespace org::apache::nifi::minifi::state::response { class ResponseNode; using SharedResponseNode = gsl::not_null>; -/** - * Purpose: Defines a metric. Serialization is intended to be thread safe. - */ class ResponseNode : public virtual core::Connectable, public virtual PublishedMetricProvider { public: ~ResponseNode() override = default; @@ -48,10 +44,6 @@ class ResponseNode : public virtual core::Connectable, public virtual PublishedM virtual bool isEmpty() = 0; }; -/** - * Purpose: Retrieves Metrics from the defined class. The current Metric, which is a consumable for any reader of Metrics must have the ability to set metrics. - * - */ class ResponseNodeSource { public: virtual ~ResponseNodeSource() = default; @@ -70,23 +62,10 @@ class NodeReporter { virtual ~NodeReporter() = default; - /** - * Retrieves metrics node - * @return metrics response node - */ virtual std::optional getMetricsNode(const std::string& metricsClass) const = 0; - /** - * Retrieves root nodes configured to be included in heartbeat - * @param includeManifest -- determines if manifest is to be included - * @return a list of response nodes - */ virtual std::vector getHeartbeatNodes(bool includeManifest) const = 0; - /** - * Retrieves the agent manifest to be sent as a response to C2 DESCRIBE manifest - * @return the agent manifest response node - */ virtual ReportedNode getAgentManifest() = 0; }; diff --git a/minifi-api/include/minifi-cpp/core/state/nodes/ResponseNodeLoader.h b/minifi-api/include/minifi-cpp/core/state/nodes/ResponseNodeLoader.h index ee35b10b1c..c887cb0183 100644 --- a/minifi-api/include/minifi-cpp/core/state/nodes/ResponseNodeLoader.h +++ b/minifi-api/include/minifi-cpp/core/state/nodes/ResponseNodeLoader.h @@ -17,12 +17,7 @@ */ #pragma once -#include -#include #include -#include -#include -#include #include #include "MetricsBase.h" diff --git a/minifi-api/include/minifi-cpp/utils/AnyRef.h b/minifi-api/include/minifi-cpp/utils/AnyRef.h deleted file mode 100644 index 05b06ffb45..0000000000 --- a/minifi-api/include/minifi-cpp/utils/AnyRef.h +++ /dev/null @@ -1,29 +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. - */ -#pragma once - -namespace org::apache::nifi::minifi::utils { - -class AnyRef { - class Base { - - }; - public: - -}; - -} // namespace org::apache::nifi::minifi::utils diff --git a/minifi-api/include/minifi-cpp/utils/TimeUtil.h b/minifi-api/include/minifi-cpp/utils/TimeUtil.h index aa16657118..6969261e64 100644 --- a/minifi-api/include/minifi-cpp/utils/TimeUtil.h +++ b/minifi-api/include/minifi-cpp/utils/TimeUtil.h @@ -22,9 +22,6 @@ namespace org::apache::nifi::minifi::utils::timeutils { -/** - * Mockable clock classes - */ class Clock { public: virtual ~Clock() = default; diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 138aaec3e8..6a763a5561 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -13,7 +13,6 @@ file(GLOB SOURCES add_minifi_library(minifi-utils STATIC ${SOURCES}) target_include_directories(minifi-utils PUBLIC include) -#target_link_libraries(minifi-utils PUBLIC minifi-core magic_enum gsl-lite range-v3 expected-lite spdlog) target_link_libraries(minifi-utils PUBLIC minifi-core ZLIB::ZLIB concurrentqueue RapidJSON spdlog Threads::Threads gsl-lite libsodium range-v3 expected-lite date::date date::tz asio magic_enum OpenSSL::Crypto OpenSSL::SSL CURL::libcurl RapidJSON) if(NOT WIN32) target_link_libraries(minifi-utils PUBLIC OSSP::libuuid++) diff --git a/utils/include/core/ContentRepository.h b/utils/include/core/ContentRepository.h index 81122eaaad..ab9d975338 100644 --- a/utils/include/core/ContentRepository.h +++ b/utils/include/core/ContentRepository.h @@ -33,9 +33,6 @@ namespace org::apache::nifi::minifi::core { -/** - * Content repository definition that extends StreamManager. - */ class ContentRepositoryImpl : public CoreComponentImpl, public StreamManagerImpl, public RepositoryMetricsSourceImpl, public virtual ContentRepository { class ContentStreamAppendLock : public StreamAppendLock { public: @@ -50,8 +47,6 @@ class ContentRepositoryImpl : public CoreComponentImpl, public StreamManagerImpl explicit ContentRepositoryImpl(std::string_view name, const utils::Identifier& uuid = {}) : core::CoreComponentImpl(name, uuid) {} ~ContentRepositoryImpl() override = default; - bool initialize(const std::shared_ptr &configure) override = 0; - std::string getStoragePath() const override; std::shared_ptr createSession() override; void reset() override; @@ -60,8 +55,6 @@ class ContentRepositoryImpl : public CoreComponentImpl, public StreamManagerImpl void incrementStreamCount(const minifi::ResourceClaim &streamId) override; StreamState decrementStreamCount(const minifi::ResourceClaim &streamId) override; - void clearOrphans() override = 0; - void start() override {} void stop() override {} diff --git a/utils/include/core/Core.h b/utils/include/core/Core.h index 85038ab4e4..ddbd58fb38 100644 --- a/utils/include/core/Core.h +++ b/utils/include/core/Core.h @@ -99,30 +99,14 @@ class CoreComponentImpl : public virtual CoreComponent { ~CoreComponentImpl() override = default; - // Get component name [[nodiscard]] std::string getName() const override; - /** - * Set name. - * @param name - */ void setName(std::string name) override; - /** - * Set UUID in this instance - * @param uuid uuid to apply to the internal representation. - */ void setUUID(const utils::Identifier& uuid) override; - /** - * Returns the UUID. - * @return the uuid of the component - */ [[nodiscard]] utils::Identifier getUUID() const override; - /** - * Return the UUID string - */ [[nodiscard]] utils::SmallString<36> getUUIDStr() const override { return uuid_.to_string(); } @@ -133,8 +117,6 @@ class CoreComponentImpl : public virtual CoreComponent { protected: // A global unique identifier utils::Identifier uuid_; - - // CoreComponent's name std::string name_; }; diff --git a/utils/include/core/ProcessContext.h b/utils/include/core/ProcessContext.h index d935e8b589..5ed76c4327 100644 --- a/utils/include/core/ProcessContext.h +++ b/utils/include/core/ProcessContext.h @@ -48,9 +48,6 @@ namespace org::apache::nifi::minifi::core { class ProcessContextImpl : public core::VariableRegistryImpl, public virtual ProcessContext { public: - /*! - * Create a new process context associated with the processor/controller service/state manager - */ ProcessContextImpl(const std::shared_ptr &processor, controller::ControllerServiceProvider* controller_service_provider, const std::shared_ptr &repo, const std::shared_ptr &flow_repo, const std::shared_ptr &content_repo = repository::createFileSystemRepository()) : VariableRegistryImpl(Configure::create()), @@ -65,9 +62,6 @@ class ProcessContextImpl : public core::VariableRegistryImpl, public virtual Pro state_storage_ = getStateStorage(logger_, controller_service_provider_, nullptr); } - /*! - * Create a new process context associated with the processor/controller service/state manager - */ ProcessContextImpl(const std::shared_ptr &processor, controller::ControllerServiceProvider* controller_service_provider, const std::shared_ptr &repo, const std::shared_ptr &flow_repo, const std::shared_ptr &configuration, const std::shared_ptr &content_repo = repository::createFileSystemRepository()) : VariableRegistryImpl(configuration), @@ -114,29 +108,24 @@ class ProcessContextImpl : public core::VariableRegistryImpl, public virtual Pro std::vector getDynamicPropertyKeys() const override { return processor_node_->getDynamicPropertyKeys(); } - // Sets the property value using the property's string name bool setProperty(const std::string &name, std::string value) override { return processor_node_->setProperty(name, value); - } // Sets the dynamic property value using the property's string name + } bool setDynamicProperty(const std::string &name, std::string value) override { return processor_node_->setDynamicProperty(name, value); } - // Sets the property value using the Property object bool setProperty(const Property& property, std::string value) override { return setProperty(property.getName(), value); } bool setProperty(const PropertyReference& property, std::string_view value) override { return setProperty(std::string{property.name}, std::string{value}); } - // Check whether the relationship is auto terminated bool isAutoTerminated(Relationship relationship) const override { return processor_node_->isAutoTerminated(relationship); } - // Get ProcessContext Maximum Concurrent Tasks uint8_t getMaxConcurrentTasks() const override { return processor_node_->getMaxConcurrentTasks(); } - // Yield based on the yield period void yield() override { processor_node_->yield(); } @@ -145,10 +134,6 @@ class ProcessContextImpl : public core::VariableRegistryImpl, public virtual Pro return repo_; } - /** - * Returns a reference to the content repository for the running instance. - * @return content repository shared pointer. - */ std::shared_ptr getContentRepository() const override { return content_repo_; } @@ -157,8 +142,6 @@ class ProcessContextImpl : public core::VariableRegistryImpl, public virtual Pro return flow_repo_; } - // Prevent default copy constructor and assignment operation - // Only support pass by reference or pointer ProcessContextImpl(const ProcessContextImpl &parent) = delete; ProcessContextImpl &operator=(const ProcessContextImpl &parent) = delete; diff --git a/utils/include/core/ProcessorMetrics.h b/utils/include/core/ProcessorMetrics.h index e921c7e4f5..9bc3c06120 100644 --- a/utils/include/core/ProcessorMetrics.h +++ b/utils/include/core/ProcessorMetrics.h @@ -54,12 +54,12 @@ class ProcessorMetricsImpl : public state::response::ResponseNodeImpl, public vi void addLastSessionCommitRuntime(std::chrono::milliseconds runtime) override; std::atomic& iterations() override {return iterations_;} - std::atomic& transferred_flow_files() override {return transferred_flow_files_;} - std::atomic& transferred_bytes() override {return transferred_bytes_;} + std::atomic& transferredFlowFiles() override {return transferred_flow_files_;} + std::atomic& transferredBytes() override {return transferred_bytes_;} const std::atomic& iterations() const override {return iterations_;} - const std::atomic& transferred_flow_files() const override {return transferred_flow_files_;} - const std::atomic& transferred_bytes() const override {return transferred_bytes_;} + const std::atomic& transferredFlowFiles() const override {return transferred_flow_files_;} + const std::atomic& transferredBytes() const override {return transferred_bytes_;} protected: template diff --git a/utils/include/core/Repository.h b/utils/include/core/Repository.h index 1dd8acaa31..b5f25a0e29 100644 --- a/utils/include/core/Repository.h +++ b/utils/include/core/Repository.h @@ -123,8 +123,6 @@ class RepositoryImpl : public core::CoreComponentImpl, public core::RepositoryMe return getName(); } - // Prevent default copy constructor and assignment operation - // Only support pass by reference or pointer RepositoryImpl(const RepositoryImpl &parent) = delete; RepositoryImpl &operator=(const RepositoryImpl &parent) = delete; diff --git a/utils/include/io/BaseStream.h b/utils/include/io/BaseStream.h index fa11305fa1..99b62d1593 100644 --- a/utils/include/io/BaseStream.h +++ b/utils/include/io/BaseStream.h @@ -18,10 +18,6 @@ #pragma once -#include -#include -#include -#include #include "InputStream.h" #include "OutputStream.h" #include "minifi-cpp/io/BaseStream.h" diff --git a/utils/include/utils/MinifiConcurrentQueue.h b/utils/include/utils/MinifiConcurrentQueue.h index 1db58080be..490cc601a3 100644 --- a/utils/include/utils/MinifiConcurrentQueue.h +++ b/utils/include/utils/MinifiConcurrentQueue.h @@ -14,9 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef LIBMINIFI_INCLUDE_UTILS_MINIFICONCURRENTQUEUE_H_ -#define LIBMINIFI_INCLUDE_UTILS_MINIFICONCURRENTQUEUE_H_ - +#pragma once #include #include @@ -29,11 +27,7 @@ #include "utils/TryMoveCall.h" -namespace org { -namespace apache { -namespace nifi { -namespace minifi { -namespace utils { +namespace org::apache::nifi::minifi::utils { // Provides a queue API and guarantees no race conditions in case of multiple producers and consumers. // Guarantees elements to be dequeued in order of insertion @@ -242,10 +236,4 @@ class ConditionConcurrentQueue : private ConcurrentQueue { std::condition_variable cv_; }; -} // namespace utils -} // namespace minifi -} // namespace nifi -} // namespace apache -} // namespace org - -#endif // LIBMINIFI_INCLUDE_UTILS_MINIFICONCURRENTQUEUE_H_ +} // namespace org::apache::nifi::minifi::utils diff --git a/utils/src/core/Core.cpp b/utils/src/core/Core.cpp index a42b315b9d..66920bba5b 100644 --- a/utils/src/core/Core.cpp +++ b/utils/src/core/Core.cpp @@ -25,28 +25,24 @@ namespace org::apache::nifi::minifi::core { CoreComponentImpl::CoreComponentImpl(std::string_view name, const utils::Identifier& uuid, const std::shared_ptr& idGenerator) : name_(name) { if (uuid.isNil()) { - // Generate the global UUID for the flow record uuid_ = idGenerator->generate(); } else { uuid_ = uuid; } } -// Set UUID void CoreComponentImpl::setUUID(const utils::Identifier& uuid) { uuid_ = uuid; } -// Get UUID utils::Identifier CoreComponentImpl::getUUID() const { return uuid_; } -// Set Processor Name void CoreComponentImpl::setName(std::string name) { name_ = std::move(name); } -// Get Process Name + std::string CoreComponentImpl::getName() const { return name_; } diff --git a/utils/src/core/ProcessorMetrics.cpp b/utils/src/core/ProcessorMetrics.cpp index 75b13ead38..d79e2eb7b5 100644 --- a/utils/src/core/ProcessorMetrics.cpp +++ b/utils/src/core/ProcessorMetrics.cpp @@ -49,8 +49,8 @@ std::vector ProcessorMetricsImpl::seria {.name = "LastOnTriggerRunTime", .value = static_cast(getLastOnTriggerRuntime().count())}, {.name = "AverageSessionCommitRunTime", .value = static_cast(getAverageSessionCommitRuntime().count())}, {.name = "LastSessionCommitRunTime", .value = static_cast(getLastSessionCommitRuntime().count())}, - {.name = "TransferredFlowFiles", .value = static_cast(transferred_flow_files().load())}, - {.name = "TransferredBytes", .value = transferred_bytes().load()} + {.name = "TransferredFlowFiles", .value = static_cast(transferredFlowFiles().load())}, + {.name = "TransferredBytes", .value = transferredBytes().load()} } }; @@ -78,8 +78,8 @@ std::vector ProcessorMetricsImpl::calculateMetrics() { {"last_onTrigger_runtime_milliseconds", static_cast(getLastOnTriggerRuntime().count()), getCommonLabels()}, {"average_session_commit_runtime_milliseconds", static_cast(getAverageSessionCommitRuntime().count()), getCommonLabels()}, {"last_session_commit_runtime_milliseconds", static_cast(getLastSessionCommitRuntime().count()), getCommonLabels()}, - {"transferred_flow_files", static_cast(transferred_flow_files().load()), getCommonLabels()}, - {"transferred_bytes", static_cast(transferred_bytes().load()), getCommonLabels()} + {"transferred_flow_files", static_cast(transferredFlowFiles().load()), getCommonLabels()}, + {"transferred_bytes", static_cast(transferredBytes().load()), getCommonLabels()} }; {