adamdebreceni commented on code in PR #2195:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2195#discussion_r3528273509


##########
libminifi/src/core/reporting/SiteToSiteProvenanceReportingTask.cpp:
##########
@@ -148,24 +147,27 @@ void 
SiteToSiteProvenanceReportingTask::getJsonReport(core::ProcessContext&, cor
   rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(buffer);
   array.Accept(writer);
 
-  report = buffer.GetString();
-}
-
-void SiteToSiteProvenanceReportingTask::onSchedule(core::ProcessContext&, 
core::ProcessSessionFactory&) {
+  return buffer.GetString();
 }
 
 void SiteToSiteProvenanceReportingTask::onTrigger(core::ProcessContext& 
context, core::ProcessSession& session) {
-  logger_->log_debug("SiteToSiteProvenanceReportingTask -- onTrigger");
-  std::vector<std::shared_ptr<core::SerializableComponent>> records;
-  logger_->log_debug("batch size {} records", batch_size_);
-  size_t deserialized = batch_size_;
+  auto* state_manager = context.getStateManager();
+  if (!state_manager) {
+    logger_->log_error("Failed to get StateManager");
+    context.yield();
+    return;
+  }
   std::shared_ptr<core::Repository> repo = context.getProvenanceRepository();
-  if (!repo->getElements(records, deserialized) && deserialized == 0) {
+  if (!repo) {
+    throw minifi::Exception(ExceptionType::REPOSITORY_EXCEPTION, "Failed to 
retrieve provenance repository");
+  }

Review Comment:
   no, exceptions form onTrigger are handled correctly



-- 
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]

Reply via email to