-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MINIFICPP-2462 - Divide libminifi #1902
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few additional comments we talked about in person that should be done afterwards in different PRs and should create separate Jira tickets for:
- we should add Impl suffix to core/* files in future
- Move core/include/minifi-cpp directory minifi-api/include/minifi-cpp-api and later have a separate minifi-c-api directory for C API
- remove ThreadedRepository.h from minifi api and replace its usage with core::TraceableResource
// 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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these comments can be removed
namespace org { | ||
namespace apache { | ||
namespace nifi { | ||
namespace minifi { | ||
namespace core { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These namespaces can be merged
/** | ||
* Factory that is used as an interface for | ||
* creating processors from shared objects. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment valid?
#include <algorithm> | ||
#include <atomic> | ||
#include <concepts> | ||
#include <map> | ||
#include <memory> | ||
#include <mutex> | ||
#include <optional> | ||
#include <queue> | ||
#include <string> | ||
#include <unordered_map> | ||
#include <vector> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some includes like algorithm, athomic, concepts, map, mutex, queue, unordered_map can be removed
#include <string> | ||
#include <vector> | ||
#include <queue> | ||
#include <map> | ||
#include <mutex> | ||
#include <atomic> | ||
#include <algorithm> | ||
#include <memory> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vector, queue, atomic, mutex, map can be removed here (maybe Property.h and VariableRegistry.h as well)
*/ | ||
#pragma once | ||
|
||
#include "minifi-cpp/utils/Literals.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before
#ifndef LIBMINIFI_INCLUDE_UTILS_MINIFICONCURRENTQUEUE_H_ | ||
#define LIBMINIFI_INCLUDE_UTILS_MINIFICONCURRENTQUEUE_H_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be changed to #pragma once
namespace org { | ||
namespace apache { | ||
namespace nifi { | ||
namespace minifi { | ||
namespace utils { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can merge these namespaces
|
||
#pragma once | ||
|
||
#include "minifi-cpp/utils/gsl.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before
// Set UUID | ||
void CoreComponent::setUUID(const utils::Identifier& uuid) { | ||
void CoreComponentImpl::setUUID(const utils::Identifier& uuid) { | ||
uuid_ = uuid; | ||
} | ||
|
||
// Get UUID | ||
utils::Identifier CoreComponent::getUUID() const { | ||
utils::Identifier CoreComponentImpl::getUUID() const { | ||
return uuid_; | ||
} | ||
|
||
// Set Processor Name | ||
void CoreComponent::setName(std::string name) { | ||
void CoreComponentImpl::setName(std::string name) { | ||
name_ = std::move(name); | ||
} | ||
// Get Process Name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These useless comments can be removed
f5fecde
to
53c2983
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've started to implement my new PR-s on top of this.
Dont want to further increase the size of the PR with nitpicks (since you touched almost the whole codebase I think we can skip the clang-tidy fixes aswell)
Great work LGTM 👍 please rebase and fix the rebase issues
Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically main)?
Is your initial contribution a single, squashed commit?
For code changes:
For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.