-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate out minifi-api/extension-utils/utils from libminifi
- Loading branch information
1 parent
db574c8
commit 37eedc3
Showing
786 changed files
with
13,172 additions
and
5,931 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
add_library(minifi-core INTERFACE) | ||
target_include_directories(minifi-core INTERFACE include) | ||
target_link_libraries(minifi-core INTERFACE gsl-lite) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** | ||
* @file Connection.h | ||
* Connection class declaration | ||
* | ||
* 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 | ||
|
||
#include <memory> | ||
#include <set> | ||
#include <string> | ||
#include <vector> | ||
#include <map> | ||
#include <mutex> | ||
#include <atomic> | ||
#include <algorithm> | ||
#include <utility> | ||
#include "core/Core.h" | ||
#include "core/Connectable.h" | ||
#include "core/logging/Logger.h" | ||
#include "core/Relationship.h" | ||
#include "core/FlowFile.h" | ||
#include "core/Repository.h" | ||
#include "minifi-cpp/utils/Literals.h" | ||
|
||
namespace org::apache::nifi::minifi { | ||
|
||
class Connection : public virtual core::Connectable { | ||
public: | ||
~Connection() override = default; | ||
|
||
static constexpr uint64_t DEFAULT_BACKPRESSURE_THRESHOLD_COUNT = 2000; | ||
static constexpr uint64_t DEFAULT_BACKPRESSURE_THRESHOLD_DATA_SIZE = 100_MB; | ||
|
||
virtual void setSourceUUID(const utils::Identifier &uuid) = 0; | ||
virtual void setDestinationUUID(const utils::Identifier &uuid) = 0; | ||
virtual utils::Identifier getSourceUUID() const = 0; | ||
virtual utils::Identifier getDestinationUUID() const = 0; | ||
virtual void setSource(core::Connectable* source) = 0; | ||
virtual core::Connectable* getSource() const = 0; | ||
virtual void setDestination(core::Connectable* dest) = 0; | ||
virtual core::Connectable* getDestination() const = 0; | ||
virtual void addRelationship(core::Relationship relationship) = 0; | ||
virtual const std::set<core::Relationship> &getRelationships() const = 0; | ||
virtual void setBackpressureThresholdCount(uint64_t size) = 0; | ||
virtual uint64_t getBackpressureThresholdCount() const = 0; | ||
virtual void setBackpressureThresholdDataSize(uint64_t size) = 0; | ||
virtual uint64_t getBackpressureThresholdDataSize() const = 0; | ||
virtual void setSwapThreshold(uint64_t size) = 0; | ||
virtual void setFlowExpirationDuration(std::chrono::milliseconds duration) = 0; | ||
virtual std::chrono::milliseconds getFlowExpirationDuration() const = 0; | ||
virtual void setDropEmptyFlowFiles(bool drop) = 0; | ||
virtual bool getDropEmptyFlowFiles() const = 0; | ||
virtual bool isEmpty() const = 0; | ||
virtual bool backpressureThresholdReached() const = 0; | ||
virtual uint64_t getQueueSize() const = 0; | ||
virtual uint64_t getQueueDataSize() = 0; | ||
virtual void multiPut(std::vector<std::shared_ptr<core::FlowFile>>& flows) = 0; | ||
virtual std::shared_ptr<core::FlowFile> poll(std::set<std::shared_ptr<core::FlowFile>> &expiredFlowRecords) = 0; | ||
virtual void drain(bool delete_permanently) = 0; | ||
}; | ||
} // namespace org::apache::nifi::minifi |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* @file FlowFileRecord.h | ||
* Flow file record class declaration | ||
* | ||
* 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 | ||
|
||
#include <memory> | ||
#include <string> | ||
#include <vector> | ||
#include <queue> | ||
#include <map> | ||
#include <mutex> | ||
#include <atomic> | ||
#include <iostream> | ||
#include <sstream> | ||
#include <fstream> | ||
#include <set> | ||
#include "minifi-cpp/core/ContentRepository.h" | ||
#include "minifi-cpp/core/FlowFile.h" | ||
#include "minifi-cpp/core/Repository.h" | ||
#include "io/OutputStream.h" | ||
|
||
namespace org::apache::nifi::minifi { | ||
|
||
class FlowFileRecord : public virtual core::FlowFile { | ||
public: | ||
virtual bool Serialize(io::OutputStream &outStream) = 0; | ||
|
||
//! Serialize and Persistent to the repository | ||
virtual bool Persist(const std::shared_ptr<core::Repository>& flowRepository) = 0; | ||
|
||
static std::shared_ptr<FlowFileRecord> DeSerialize(std::span<const std::byte> buffer, const std::shared_ptr<core::ContentRepository> &content_repo, utils::Identifier &container); | ||
static std::shared_ptr<FlowFileRecord> DeSerialize(io::InputStream &stream, const std::shared_ptr<core::ContentRepository> &content_repo, utils::Identifier &container); | ||
static std::shared_ptr<FlowFileRecord> DeSerialize(const std::string& key, const std::shared_ptr<core::Repository>& flowRepository, | ||
const std::shared_ptr<core::ContentRepository> &content_repo, utils::Identifier &container); | ||
|
||
virtual std::string getContentFullPath() const = 0; | ||
}; | ||
|
||
} // namespace org::apache::nifi::minifi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* 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 | ||
|
||
#include <string> | ||
#include <vector> | ||
#include <queue> | ||
#include <map> | ||
#include <memory> | ||
#include <mutex> | ||
#include <atomic> | ||
#include "core/Core.h" | ||
#include "core/StreamManager.h" | ||
#include "properties/Configure.h" | ||
#include "utils/Id.h" | ||
|
||
namespace org::apache::nifi::minifi { | ||
|
||
namespace core { | ||
class ContentRepository; | ||
} // namespace core | ||
|
||
class ResourceClaim { | ||
public: | ||
using Path = std::string; | ||
|
||
virtual ~ResourceClaim() = default; | ||
virtual void increaseFlowFileRecordOwnedCount() = 0; | ||
virtual void decreaseFlowFileRecordOwnedCount() = 0; | ||
virtual uint64_t getFlowFileRecordOwnedCount() = 0; | ||
virtual Path getContentFullPath() const = 0; | ||
virtual bool exists() = 0; | ||
|
||
static std::shared_ptr<ResourceClaim> create(std::shared_ptr<core::ContentRepository> repository); | ||
|
||
virtual std::ostream& write(std::ostream& stream) const = 0; | ||
|
||
friend std::ostream& operator<<(std::ostream& stream, const ResourceClaim& claim) { | ||
return claim.write(stream); | ||
} | ||
|
||
friend std::ostream& operator<<(std::ostream& stream, const std::shared_ptr<ResourceClaim>& claim) { | ||
return claim->write(stream); | ||
} | ||
}; | ||
|
||
} // namespace org::apache::nifi::minifi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/** | ||
* 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 | ||
|
||
#include <map> | ||
#include <string> | ||
#include <utility> | ||
#include <vector> | ||
|
||
#include "minifi-cpp/core/Annotation.h" | ||
#include "minifi-cpp/core/DynamicProperty.h" | ||
#include "minifi-cpp/core/OutputAttributeDefinition.h" | ||
#include "minifi-cpp/core/Property.h" | ||
#include "minifi-cpp/core/Relationship.h" | ||
#include "minifi-cpp/core/RelationshipDefinition.h" | ||
|
||
namespace org::apache::nifi::minifi { | ||
|
||
enum class ResourceType { | ||
Processor, ControllerService, InternalResource, DescriptionOnly | ||
}; | ||
|
||
struct ClassDescription { | ||
ResourceType type_ = ResourceType::Processor; | ||
std::string short_name_{}; | ||
std::string full_name_{}; | ||
std::string description_{}; | ||
std::vector<core::Property> class_properties_{}; | ||
std::span<const core::DynamicProperty> dynamic_properties_{}; | ||
std::vector<core::Relationship> class_relationships_{}; | ||
std::span<const core::OutputAttributeReference> output_attributes_{}; | ||
bool supports_dynamic_properties_ = false; | ||
bool supports_dynamic_relationships_ = false; | ||
std::string inputRequirement_{}; | ||
bool isSingleThreaded_ = false; | ||
}; | ||
|
||
struct Components { | ||
std::vector<ClassDescription> processors_; | ||
std::vector<ClassDescription> controller_services_; | ||
std::vector<ClassDescription> other_components_; | ||
|
||
[[nodiscard]] bool empty() const noexcept { | ||
return processors_.empty() && controller_services_.empty() && other_components_.empty(); | ||
} | ||
}; | ||
|
||
class AgentDocs { | ||
public: | ||
static const std::map<std::string, Components>& getClassDescriptions(); | ||
static std::map<std::string, Components>& getMutableClassDescriptions(); | ||
|
||
template<typename Class, ResourceType Type> | ||
static void createClassDescription(const std::string& group, const std::string& name); | ||
}; | ||
|
||
} // namespace org::apache::nifi::minifi |
Oops, something went wrong.