arpadboda commented on a change in pull request #613: Minificpp 927 Nanofi
tailfile delimited processor
URL: https://github.com/apache/nifi-minifi-cpp/pull/613#discussion_r309660907
##########
File path: nanofi/src/api/nanofi.cpp
##########
@@ -124,25 +124,42 @@ nifi_instance *create_instance(const char *url,
nifi_port *port) {
return instance;
}
-standalone_processor *create_processor(const char *name) {
+standalone_processor * create_processor(const char *name, nifi_instance *
instance) {
NULL_CHECK(nullptr, name);
auto ptr = ExecutionPlan::createProcessor(name, name);
if (!ptr) {
return nullptr;
}
- if (standalone_instance == nullptr) {
+ if (instance == NULL) {
nifi_port port;
char portnum[] = "98765";
port.port_id = portnum;
- standalone_instance = create_instance("internal_standalone", &port);
+ instance = create_instance("internal_standalone", &port);
}
- auto flow = create_new_flow(standalone_instance);
+ auto flow = create_new_flow(instance);
std::shared_ptr<ExecutionPlan> plan(flow);
plan->addProcessor(ptr, name);
ExecutionPlan::addProcessorWithPlan(ptr->getUUIDStr(), plan);
return static_cast<standalone_processor*>(ptr.get());
}
+void initialize_content_repo(processor_context * ctx) {
+ ctx->initializeContentRepository(get_current_working_directory());
+}
+
+char * get_proc_uuid_from_processor(standalone_processor * proc) {
+ const std::string uuid = proc->getUUIDStr();
+ uint64_t len = uuid.size();
+ char * uuid_str = (char *)malloc((len+1) * sizeof(char));
+ strcpy(uuid_str, uuid.c_str());
+ return uuid_str;
+}
+
+char * get_proc_uuid_from_context(processor_context * ctx) {
Review comment:
const char * here as well, morover the input context could be const, too.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services