Skip to content

Commit 52b5626

Browse files
committed
MINIFICPP-2708 Controller Service C API
1 parent 0e54f0b commit 52b5626

File tree

31 files changed

+342
-71
lines changed

31 files changed

+342
-71
lines changed

Extensions.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ extern "C" MinifiExtension* InitExtension(MinifiConfig* /*config*/) {
4747
.deinit = nullptr,
4848
.user_data = nullptr,
4949
.processors_count = 0,
50-
.processors_ptr = nullptr
50+
.processors_ptr = nullptr,
51+
.controller_services_count = 0,
52+
.controller_services_ptr = nullptr,
53+
5154
};
5255
return MinifiCreateExtension(minifi::utils::toStringView(MINIFI_API_VERSION), &ext_create_info);
5356
}

core-framework/include/agent/agent_docs.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@
1616
*/
1717
#pragma once
1818

19-
#include "minifi-cpp/agent/agent_docs.h"
20-
2119
#include <map>
2220
#include <string>
2321
#include <utility>
2422
#include <vector>
2523

26-
#include "utils/StringUtils.h"
2724
#include "core/ClassName.h"
28-
#include "minifi-cpp/core/OutputAttribute.h"
29-
#include "minifi-cpp/core/ControllerServiceApi.h"
25+
#include "minifi-cpp/agent/agent_docs.h"
26+
#include "minifi-cpp/core/ControllerServiceType.h"
3027
#include "minifi-cpp/core/DynamicProperty.h"
28+
#include "minifi-cpp/core/OutputAttribute.h"
29+
#include "utils/StringUtils.h"
3130

3231
namespace org::apache::nifi::minifi {
3332

@@ -44,8 +43,8 @@ inline auto toVector(std::span<const core::OutputAttributeReference> attributes)
4443
return std::vector<core::OutputAttribute>(attributes.begin(), attributes.end());
4544
}
4645

47-
inline auto toVector(std::span<const core::ControllerServiceApiDefinition> apis) {
48-
return std::vector<core::ControllerServiceApi>(apis.begin(), apis.end());
46+
inline auto toVector(std::span<const core::ControllerServiceTypeDefinition> apis) {
47+
return std::vector<core::ControllerServiceType>(apis.begin(), apis.end());
4948
}
5049

5150
inline auto toVector(std::span<const core::DynamicPropertyDefinition> properties) {

core-framework/include/core/controller/ControllerServiceBase.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#include "core/Connectable.h"
2929
#include "minifi-cpp/core/controller/ControllerServiceApi.h"
3030
#include "minifi-cpp/core/controller/ControllerServiceInterface.h"
31-
#include "minifi-cpp/core/ControllerServiceApiDefinition.h"
32-
#include "minifi-cpp/core/controller/ControllerServiceMetadata.h"
31+
#include "minifi-cpp/core/ControllerServiceTypeDefinition.h"
32+
#include "minifi-cpp/core/ControllerServiceMetadata.h"
3333

3434
namespace org::apache::nifi::minifi::core::controller {
3535

@@ -100,7 +100,7 @@ class ControllerServiceBase : public ControllerServiceApi {
100100
}
101101

102102

103-
static constexpr auto ImplementsApis = std::array<ControllerServiceApiDefinition, 0>{};
103+
static constexpr auto ImplementsApis = std::array<ControllerServiceTypeDefinition, 0>{};
104104

105105
protected:
106106
std::string name_;

core-framework/include/core/controller/ControllerServiceFactoryImpl.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717

1818
#pragma once
1919

20-
#include <string>
2120
#include <memory>
21+
#include <string>
2222
#include <utility>
23+
2324
#include "core/ClassName.h"
25+
#include "minifi-cpp/core/ControllerServiceMetadata.h"
2426
#include "minifi-cpp/core/controller/ControllerServiceFactory.h"
2527

2628
namespace org::apache::nifi::minifi::core::controller {

core-framework/include/http/HTTPClient.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include "minifi-cpp/core/logging/Logger.h"
4646
#include "core/logging/LoggerFactory.h"
4747
#include "minifi-cpp/controllers/SSLContextServiceInterface.h"
48+
#include "minifi-cpp/core/PropertyDefinition.h"
4849
#include "utils/ByteArrayCallback.h"
4950

5051
namespace org::apache::nifi::minifi::http {

extensions/aws/tests/MultipartUploadStateStorageTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class MultipartUploadStateStorageTestFixture {
3232
MultipartUploadStateStorageTestFixture() {
3333
LogTestController::getInstance().setDebug<minifi::aws::s3::MultipartUploadStateStorage>();
3434
const auto storage_uuid = minifi::utils::IdGenerator::getIdGenerator()->generate();
35-
state_storage_ = std::make_unique<minifi::controllers::VolatileMapStateStorage>(core::controller::ControllerServiceMetadata{
35+
state_storage_ = std::make_unique<minifi::controllers::VolatileMapStateStorage>(core::ControllerServiceMetadata{
3636
.uuid = storage_uuid,
3737
.name = "KeyValueStateStorage",
3838
.logger = logging::LoggerFactory<minifi::controllers::VolatileMapStateStorage>::getLogger(storage_uuid)

extensions/llamacpp/processors/ExtensionInitializer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ extern "C" MinifiExtension* InitExtension(MinifiConfig* /*config*/) {
3434
.user_data = nullptr,
3535
.processors_count = 1,
3636
.processors_ptr = &description,
37+
.controller_services_count = 0,
38+
.controller_services_ptr = nullptr,
3739
};
3840
extension = MinifiCreateExtension(minifi::api::utils::toStringView(MINIFI_API_VERSION), &ext_create_info);
3941
});

extensions/opencv/OpenCVLoader.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ extern "C" MinifiExtension* InitExtension(MinifiConfig* /*config*/) {
4040
.deinit = nullptr,
4141
.user_data = nullptr,
4242
.processors_count = 0,
43-
.processors_ptr = nullptr
43+
.processors_ptr = nullptr,
44+
.controller_services_count = 0,
45+
.controller_services_ptr = nullptr,
4446
};
4547
return MinifiCreateExtension(minifi::utils::toStringView(MINIFI_API_VERSION), &ext_create_info);
4648
}

extensions/python/pythonlibloader/PythonLibLoader.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ extern "C" MinifiExtension* InitExtension(MinifiConfig* config) {
112112
.deinit = nullptr,
113113
.user_data = nullptr,
114114
.processors_count = 0,
115-
.processors_ptr = nullptr
115+
.processors_ptr = nullptr,
116+
.controller_services_count = 0,
117+
.controller_services_ptr = nullptr,
116118
};
117119
return MinifiCreateExtension(minifi::utils::toStringView(MINIFI_API_VERSION), &ext_create_info);
118120
}

extensions/python/pythonloader/PyProcLoader.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ extern "C" MinifiExtension* InitExtension(MinifiConfig* config) {
4747
.deinit = nullptr,
4848
.user_data = nullptr,
4949
.processors_count = 0,
50-
.processors_ptr = nullptr
50+
.processors_ptr = nullptr,
51+
.controller_services_count = 0,
52+
.controller_services_ptr = nullptr,
5153
};
5254
return MinifiCreateExtension(minifi::utils::toStringView(MINIFI_API_VERSION), &ext_create_info);
5355
}

0 commit comments

Comments
 (0)