Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

MINIFICPP-2462 - Divide libminifi #1902

wants to merge 7 commits into from

Conversation

adamdebreceni
Copy link
Contributor

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:

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file?
  • If applicable, have you updated the NOTICE file?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

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.

Copy link
Contributor

@lordgamez lordgamez left a 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

Comment on lines 84 to 103
// 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";
Copy link
Contributor

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

Comment on lines 25 to 29
namespace org {
namespace apache {
namespace nifi {
namespace minifi {
namespace core {
Copy link
Contributor

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

Comment on lines 31 to 34
/**
* Factory that is used as an interface for
* creating processors from shared objects.
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment valid?

Comment on lines 19 to 29
#include <algorithm>
#include <atomic>
#include <concepts>
#include <map>
#include <memory>
#include <mutex>
#include <optional>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>
Copy link
Contributor

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

Comment on lines 19 to 26
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <mutex>
#include <atomic>
#include <algorithm>
#include <memory>
Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before

Comment on lines 17 to 18
#ifndef LIBMINIFI_INCLUDE_UTILS_MINIFICONCURRENTQUEUE_H_
#define LIBMINIFI_INCLUDE_UTILS_MINIFICONCURRENTQUEUE_H_
Copy link
Contributor

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

Comment on lines 32 to 36
namespace org {
namespace apache {
namespace nifi {
namespace minifi {
namespace utils {
Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as before

Comment on lines 35 to 49
// 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
Copy link
Contributor

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

Copy link
Member

@martinzink martinzink left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants