lordgamez commented on code in PR #1840:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1840#discussion_r1822727049
##########
extensions/standard-processors/tests/unit/ExtractTextTests.cpp:
##########
@@ -47,7 +47,7 @@ const char* TEST_ATTR = "ExtractedText";
TEST_CASE("Test creation of ExtractText", "[extracttextCreate]") {
TestController testController;
- std::shared_ptr<core::Processor> processor =
std::make_shared<org::apache::nifi::minifi::processors::ExtractText>("processorname");
+ auto processor =
std::make_shared<org::apache::nifi::minifi::processors::ExtractText>("processorname");
Review Comment:
Yes, updated in 83f222da2bfa8aca81ccfae053059df384ec40a2
##########
libminifi/include/core/controller/ControllerServiceLookup.h:
##########
@@ -52,6 +52,14 @@ class ControllerServiceLookup {
*/
virtual std::shared_ptr<ControllerService> getControllerService(const
std::string &identifier) const = 0;
Review Comment:
Updated in 83f222da2bfa8aca81ccfae053059df384ec40a2
##########
libminifi/src/core/controller/ControllerServiceNodeMap.cpp:
##########
@@ -0,0 +1,96 @@
+/**
+ *
+ * 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.
+ */
+
+#include "core/controller/ControllerServiceNodeMap.h"
+#include "core/ProcessGroup.h"
+
+namespace org::apache::nifi::minifi::core::controller {
+
+ControllerServiceNode* ControllerServiceNodeMap::get(const std::string &id)
const {
+ std::lock_guard<std::mutex> lock(mutex_);
+ auto exists = controller_service_nodes_.find(id);
+ if (exists != controller_service_nodes_.end())
+ return exists->second.get();
+ else
+ return nullptr;
+}
+
+ControllerServiceNode* ControllerServiceNodeMap::get(const std::string &id,
const utils::Identifier& processor_uuid) const {
+ std::lock_guard<std::mutex> lock(mutex_);
+ ControllerServiceNode* controller = nullptr;
+ auto exists = controller_service_nodes_.find(id);
+ if (exists != controller_service_nodes_.end()) {
+ controller = exists->second.get();
+ } else {
+ return nullptr;
+ }
+
+ auto process_group_of_controller_exists = process_groups_.find(id);
+ ProcessGroup* process_group = nullptr;
+ if (process_group_of_controller_exists != process_groups_.end()) {
+ process_group = process_group_of_controller_exists->second;
+ } else {
+ return nullptr;
+ }
+
+ if (process_group->findProcessorById(processor_uuid)) {
+ return controller;
+ }
+
+ if (process_group->findControllerService(processor_uuid.to_string(),
ProcessGroup::Traverse::IncludeChildren)) {
Review Comment:
Good point, it's actually a bad variable naming here, it can be either a
linked controller service or a processor uuid we are passing in this variable.
I renamed the variable and added explicitly the `findProcessorById`'s second
traversal parameter to be more transparent in
83f222da2bfa8aca81ccfae053059df384ec40a2
##########
libminifi/include/core/controller/ControllerServiceProvider.h:
##########
@@ -66,15 +66,20 @@ class ControllerServiceProvider : public CoreComponent,
public ConfigurableCompo
return controller_map_->get(id);
}
+ virtual ControllerServiceNode* getControllerServiceNode(const std::string
&id, const utils::Identifier &controller_uuid) const {
Review Comment:
It can be either processor or controller uuid, renamed in
83f222da2bfa8aca81ccfae053059df384ec40a2
##########
libminifi/src/core/ProcessGroup.cpp:
##########
@@ -115,11 +115,18 @@ void
ProcessGroup::addProcessGroup(std::unique_ptr<ProcessGroup> child) {
void ProcessGroup::startProcessingProcessors(TimerDrivenSchedulingAgent&
timeScheduler,
EventDrivenSchedulingAgent& eventScheduler, CronDrivenSchedulingAgent&
cronScheduler) {
- std::unique_lock<std::recursive_mutex> lock(mutex_);
+
+ std::set<Processor*> processors_to_schedule;
Review Comment:
Updated in 83f222da2bfa8aca81ccfae053059df384ec40a2
--
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]