Skip to content

Commit 83f222d

Browse files
committed
Review update
1 parent bffd76b commit 83f222d

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

extensions/standard-processors/tests/unit/ExtractTextTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const char* TEST_ATTR = "ExtractedText";
4747

4848
TEST_CASE("Test creation of ExtractText", "[extracttextCreate]") {
4949
TestController testController;
50-
auto processor = std::make_shared<org::apache::nifi::minifi::processors::ExtractText>("processorname");
50+
auto processor = std::make_unique<org::apache::nifi::minifi::processors::ExtractText>("processorname");
5151
REQUIRE(processor->getName() == "processorname");
5252
utils::Identifier processoruuid = processor->getUUID();
5353
REQUIRE(processoruuid);

libminifi/include/core/controller/ControllerServiceLookup.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ class ControllerServiceLookup {
4646
virtual ~ControllerServiceLookup() = default;
4747

4848
/**
49-
* Gets the controller service via the provided identifier.
49+
* Gets the controller service via the provided identifier. This overload returns the controller service in a global scope from all
50+
* available controller services in the flow.
5051
* @param identifier reference string for controller service.
5152
* @return controller service reference.
5253
*/

libminifi/include/core/controller/ControllerServiceNodeMap.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ControllerServiceNodeMap {
4141
ControllerServiceNodeMap& operator=(ControllerServiceNodeMap&&) = delete;
4242

4343
ControllerServiceNode* get(const std::string &id) const;
44-
ControllerServiceNode* get(const std::string &id, const utils::Identifier &processor_uuid) const;
44+
ControllerServiceNode* get(const std::string &id, const utils::Identifier &processor_or_controller_uuid) const;
4545

4646
bool put(const std::string &id, const std::shared_ptr<ControllerServiceNode> &serviceNode);
4747
bool put(const std::string &id, ProcessGroup* process_group);
@@ -51,7 +51,9 @@ class ControllerServiceNodeMap {
5151

5252
protected:
5353
mutable std::mutex mutex_;
54+
// Map of controller service id to the controller service node
5455
std::map<std::string, std::shared_ptr<ControllerServiceNode>> controller_service_nodes_;
56+
// Map of controller service id to the process group that contains it
5557
std::map<std::string, gsl::not_null<ProcessGroup*>> process_groups_;
5658
};
5759

libminifi/include/core/controller/ControllerServiceProvider.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ class ControllerServiceProvider : public CoreComponent, public ConfigurableCompo
6666
return controller_map_->get(id);
6767
}
6868

69-
virtual ControllerServiceNode* getControllerServiceNode(const std::string &id, const utils::Identifier &controller_uuid) const {
70-
return controller_map_->get(id, controller_uuid);
69+
virtual ControllerServiceNode* getControllerServiceNode(const std::string &id, const utils::Identifier &processor_or_controller_uuid) const {
70+
return controller_map_->get(id, processor_or_controller_uuid);
7171
}
7272

7373
virtual void clearControllerServices() = 0;

libminifi/src/core/ProcessGroup.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ void ProcessGroup::addProcessGroup(std::unique_ptr<ProcessGroup> child) {
116116
void ProcessGroup::startProcessingProcessors(TimerDrivenSchedulingAgent& timeScheduler,
117117
EventDrivenSchedulingAgent& eventScheduler, CronDrivenSchedulingAgent& cronScheduler) {
118118

119-
std::set<Processor*> processors_to_schedule;
119+
std::vector<Processor*> processors_to_schedule;
120120
{
121121
std::unique_lock<std::recursive_mutex> lock(mutex_);
122122
for (const auto& processor : failed_processors_) {
123-
processors_to_schedule.insert(processor);
123+
processors_to_schedule.push_back(processor);
124124
}
125125
}
126126

libminifi/src/core/controller/ControllerServiceNodeMap.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ControllerServiceNode* ControllerServiceNodeMap::get(const std::string &id) cons
3030
return nullptr;
3131
}
3232

33-
ControllerServiceNode* ControllerServiceNodeMap::get(const std::string &id, const utils::Identifier& processor_uuid) const {
33+
ControllerServiceNode* ControllerServiceNodeMap::get(const std::string &id, const utils::Identifier& processor_or_controller_uuid) const {
3434
std::lock_guard<std::mutex> lock(mutex_);
3535
ControllerServiceNode* controller = nullptr;
3636
auto exists = controller_service_nodes_.find(id);
@@ -48,11 +48,11 @@ ControllerServiceNode* ControllerServiceNodeMap::get(const std::string &id, cons
4848
return nullptr;
4949
}
5050

51-
if (process_group->findProcessorById(processor_uuid)) {
51+
if (process_group->findProcessorById(processor_or_controller_uuid, ProcessGroup::Traverse::IncludeChildren)) {
5252
return controller;
5353
}
5454

55-
if (process_group->findControllerService(processor_uuid.to_string(), ProcessGroup::Traverse::IncludeChildren)) {
55+
if (process_group->findControllerService(processor_or_controller_uuid.to_string(), ProcessGroup::Traverse::IncludeChildren)) {
5656
return controller;
5757
}
5858

0 commit comments

Comments
 (0)