fgerlits commented on code in PR #1930:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1930#discussion_r2183342955
##########
extensions/python/ExecutePythonProcessor.cpp:
##########
@@ -58,6 +54,15 @@ void ExecutePythonProcessor::initialize() {
initalizeThroughScriptEngine();
}
+void ExecutePythonProcessor::initialize() {
+ initializeScript();
+ std::vector<core::PropertyReference> all_properties{Properties.begin(),
Properties.end()};
+ ranges::transform(python_properties_, std::back_inserter(all_properties),
&core::Property::getReference);
+ setSupportedProperties(all_properties);
+ setSupportedRelationships(Relationships);
+ logger_->log_debug("Processor has already been initialized, returning...");
Review Comment:
It could be useful to make this log different from the log at line 41:
```suggestion
logger_->log_debug("Processor has been initialized.");
```
##########
extensions/standard-processors/processors/RouteText.cpp:
##########
@@ -61,14 +58,12 @@ void RouteText::onSchedule(core::ProcessContext& context,
core::ProcessSessionFa
const auto static_relationships = RouteText::Relationships;
std::vector<core::RelationshipDefinition>
relationships(static_relationships.begin(), static_relationships.end());
- for (const auto& property_name : getDynamicPropertyKeys()) {
+ for (const auto& property_name : context.getDynamicPropertyKeys()) {
core::RelationshipDefinition rel{property_name, "Dynamic Route"};
dynamic_relationships_[property_name] = rel;
relationships.push_back(rel);
logger_->log_info("RouteText registered dynamic route '{}'",
property_name);
}
-
- setSupportedRelationships(relationships);
Review Comment:
why was this line removed? now the block before it has no effect
##########
minifi-api/include/minifi-cpp/core/ProcessContext.h:
##########
@@ -33,14 +32,37 @@
namespace org::apache::nifi::minifi::core {
+namespace detail {
+template<typename T>
+concept NotAFlowFile = !std::convertible_to<T &, const FlowFile &> &&
!std::convertible_to<T &, const std::shared_ptr<FlowFile> &>;
+} // namespace detail
Review Comment:
this concept is not used anywhere
##########
core-framework/include/core/ProcessorImpl.h:
##########
@@ -0,0 +1,160 @@
+/**
+ * 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 <algorithm>
+#include <atomic>
+#include <chrono>
+#include <condition_variable>
+#include <functional>
+#include <memory>
+#include <mutex>
+#include <string>
+#include <string_view>
+#include <unordered_set>
+#include <unordered_map>
+#include <utility>
+#include <vector>
+
+#include "core/ConfigurableComponentImpl.h"
+#include "core/Connectable.h"
+#include "core/Property.h"
+#include "core/Core.h"
+#include "minifi-cpp/core/Annotation.h"
+#include "minifi-cpp/core/DynamicProperty.h"
+#include "minifi-cpp/core/Scheduling.h"
+#include "minifi-cpp/core/state/nodes/MetricsBase.h"
+#include "minifi-cpp/core/ProcessorMetrics.h"
+#include "utils/gsl.h"
+#include "utils/Id.h"
+#include "minifi-cpp/core/OutputAttributeDefinition.h"
+#include "minifi-cpp/core/ProcessorApi.h"
+#include "utils/PropertyErrors.h"
+#include "minifi-cpp/core/ProcessorMetadata.h"
+#include "Exception.h"
+
+#define ADD_GET_PROCESSOR_NAME \
+ std::string getProcessorType() const override { \
+ auto class_name =
org::apache::nifi::minifi::core::className<decltype(*this)>(); \
+ auto splitted =
org::apache::nifi::minifi::utils::string::split(class_name, "::"); \
+ return splitted[splitted.size() - 1]; \
+ }
+
+#define ADD_COMMON_VIRTUAL_FUNCTIONS_FOR_PROCESSORS \
+ bool supportsDynamicProperties() const override { return
SupportsDynamicProperties; } \
+ bool supportsDynamicRelationships() const override { return
SupportsDynamicRelationships; } \
+ minifi::core::annotation::Input getInputRequirement() const override {
return InputRequirement; } \
+ bool isSingleThreaded() const override { return IsSingleThreaded; } \
+ ADD_GET_PROCESSOR_NAME
+
+namespace org::apache::nifi::minifi {
+
+class Connection;
+
+namespace core {
+
+class ProcessContext;
+class ProcessSession;
+class ProcessSessionFactory;
+
+#define BUILDING_DLL 1
+
+class ProcessorImpl : public virtual ProcessorApi {
+ public:
+ explicit ProcessorImpl(ProcessorMetadata info);
Review Comment:
Nitpicking, but I find it confusing that these `ProcessorMetadata`
parameters are named `info`, when there is a different `ProcessorInfo` class.
Could you rename them to `metadata` or `construction_params` or something
similar?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]