MINIFICPP-1390 Create DeleteS3Object processor#931
MINIFICPP-1390 Create DeleteS3Object processor#931lordgamez wants to merge 29 commits intoapache:mainfrom
Conversation
58d38e7 to
9fceb84
Compare
arpadboda
left a comment
There was a problem hiding this comment.
Mostly looks good, added some minor comments.
9fceb84 to
a2ba9ac
Compare
|
wrapping the object id in quotes when logging might improve readability of the log message (might be beneficial for the bucket id as well) (here "one" is the object id) |
5009b52 to
ccdde78
Compare
ccdde78 to
774166e
Compare
|
|
||
| ### Description | ||
|
|
||
| Deletes FlowFiles on an Amazon S3 Bucket. If attempting to delete a file that does not exist, FlowFile is routed to success. |
There was a problem hiding this comment.
This sounds like "if something does not exist it is rerouted to success".
There was a problem hiding this comment.
I see this is verbatim from NiFi, but I still don't understand what is going on. If a flowfile does not exist, this processor yields.
There was a problem hiding this comment.
We started discussing this with @arpadboda and @adebreceni in a comment above, where @adebreceni noted that it can be logical if we interpret it the following way: "if you define "success" as the post-condition "the object is not in the S3 bucket", it makes sense to transfer to "success"". So if the goal is to have the object non-existent in that bucket we succeed by doing nothing.
|
|
||
| if (!getExpressionLanguageSupportedProperties(context, flow_file)) { | ||
| context->yield(); | ||
| return; |
There was a problem hiding this comment.
Shouldn't the flowfile get transfered to Failure here?
There was a problem hiding this comment.
I think you are right, as if this fails we cannot continue with this flow file as one of the required properties is missing.
|
|
||
| void DeleteS3Object::initialize() { | ||
| // Set the supported properties | ||
| std::set<core::Property> properties(S3Processor::getSupportedProperties()); |
There was a problem hiding this comment.
Minor, but instead of adding the properties manually and defining them twiceS3Processor could set its supported properties in its constructor, and the interface for the ConfigurableComponent could be extended with insertion for new properties.
There was a problem hiding this comment.
Included in b065515. The only difference is that I did not introduce a new insertion operation in the ConfigurableComponent but used updateSupportedProperties instead.
| : S3Processor(std::move(name), uuid, logging::LoggerFactory<DeleteS3Object>::getLogger()) { | ||
| } | ||
|
|
||
| explicit DeleteS3Object(std::string name, minifi::utils::Identifier uuid, std::unique_ptr<aws::s3::S3WrapperBase> s3_wrapper) |
There was a problem hiding this comment.
Is this constructor used somewhere?
There was a problem hiding this comment.
Yes, this constructor is used in the tests to pass the mocked version of the S3 wrapper.
There was a problem hiding this comment.
if it is only used for testing we could make it private and friend a DeleteS3ObjectTestAccessor (or some other equally horrendously named class)
There was a problem hiding this comment.
Moved the constructor private in b04bddf
| core::PropertyBuilder::createProperty("Communications Timeout") | ||
| ->isRequired(true) | ||
| ->withDefaultValue<core::TimePeriodValue>("30 sec") | ||
| ->withDescription("") |
There was a problem hiding this comment.
I see that NiFi does not have this either, but shouldn't we add some explanation?
| EndpointOverrideURL, ProxyHost, ProxyPort, ProxyUsername, ProxyPassword, UseDefaultCredentials}; | ||
| } | ||
|
|
||
| minifi::utils::optional<Aws::Auth::AWSCredentials> S3Processor::getAWSCredentialsFromControllerService(const std::shared_ptr<core::ProcessContext> &context) const { |
There was a problem hiding this comment.
Minor, but minifi:: seems redundant.
There was a problem hiding this comment.
It is needed in this case, as we introduced minifi::aws::utils and this class is in the scope of the aws namespace.
4f3ac8e to
3f872f1
Compare
3f872f1 to
6b3120a
Compare
Jira issue: https://issues.apache.org/jira/browse/MINIFICPP-1390
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.