You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/12/13 12:45:49 UTC

[GitHub] [nifi-minifi-cpp] martinzink opened a new pull request, #1474: MINIFICPP-2008 Differentiate successful onTriggers from throwing onTr…

martinzink opened a new pull request, #1474:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1474

   …iggers in ScheduleAgents
   
   Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [x] Is there a JIRA ticket associated with this PR? Is it referenced
        in the commit message?
   
   - [x] Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [x] Has your PR been rebased against the latest commit within the target branch (typically main)?
   
   - [x] Is your initial contribution a single, squashed commit?
   
   ### For code changes:
   - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [x] If applicable, have you updated the LICENSE file?
   - [x] If applicable, have you updated the NOTICE file?
   
   ### For documentation related changes:
   - [x] Have you ensured that format looks appropriate for the output in which it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.
   


-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi-minifi-cpp] szaszm commented on a diff in pull request #1474: MINIFICPP-2008 Differentiate successful onTriggers from throwing onTr…

Posted by GitBox <gi...@apache.org>.
szaszm commented on code in PR #1474:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1474#discussion_r1062426632


##########
libminifi/include/CronDrivenSchedulingAgent.h:
##########
@@ -45,8 +45,6 @@ class CronDrivenSchedulingAgent : public ThreadedSchedulingAgent {
       : ThreadedSchedulingAgent(controller_service_provider, std::move(repo), std::move(flow_repo), std::move(content_repo), std::move(configuration), thread_pool) {
   }
 
-  CronDrivenSchedulingAgent(const CronDrivenSchedulingAgent& parent) = delete;
-  CronDrivenSchedulingAgent& operator=(const CronDrivenSchedulingAgent& parent) = delete;

Review Comment:
   Do you want to make this copyable, or rely on some other way of disabling copy? Why?



##########
libminifi/include/SchedulingAgent.h:
##########
@@ -90,14 +86,15 @@ class SchedulingAgent {
     logger_->log_trace("Destroying scheduling agent");
   }
 
-  // onTrigger, return whether the yield is need
-  bool onTrigger(core::Processor* processor, const std::shared_ptr<core::ProcessContext> &processContext, const std::shared_ptr<core::ProcessSessionFactory> &sessionFactory);
-  // start
+  nonstd::expected<void, std::exception_ptr> onTrigger(core::Processor* processor,
+                                                       const std::shared_ptr<core::ProcessContext>& process_context,
+                                                       const std::shared_ptr<core::ProcessSessionFactory>& session_factory);

Review Comment:
   I'm not a fan of aligned continuations. It's wasting a lot of space, and automated refactor/renaming messes it up.



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1474: MINIFICPP-2008 Differentiate successful onTriggers from throwing onTr…

Posted by GitBox <gi...@apache.org>.
martinzink commented on code in PR #1474:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1474#discussion_r1050713606


##########
libminifi/include/EventDrivenSchedulingAgent.h:
##########
@@ -54,23 +45,16 @@ class EventDrivenSchedulingAgent : public ThreadedSchedulingAgent {
     time_slice_ = std::chrono::milliseconds(slice);
   }
 
+  EventDrivenSchedulingAgent(const EventDrivenSchedulingAgent &parent) = delete;
+  EventDrivenSchedulingAgent& operator=(const EventDrivenSchedulingAgent &parent) = delete;

Review Comment:
   :+1: You are right, removed from all the child class in https://github.com/apache/nifi-minifi-cpp/pull/1474/commits/d263e1b23eeb4aa21cf3a0a9c8eb22d413af6cee



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi-minifi-cpp] adamdebreceni commented on a diff in pull request #1474: MINIFICPP-2008 Differentiate successful onTriggers from throwing onTr…

Posted by GitBox <gi...@apache.org>.
adamdebreceni commented on code in PR #1474:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1474#discussion_r1049662610


##########
libminifi/include/EventDrivenSchedulingAgent.h:
##########
@@ -54,23 +45,16 @@ class EventDrivenSchedulingAgent : public ThreadedSchedulingAgent {
     time_slice_ = std::chrono::milliseconds(slice);
   }
 
+  EventDrivenSchedulingAgent(const EventDrivenSchedulingAgent &parent) = delete;
+  EventDrivenSchedulingAgent& operator=(const EventDrivenSchedulingAgent &parent) = delete;

Review Comment:
   `SchedulingAgent` already seem to have these disabled



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi-minifi-cpp] adamdebreceni closed pull request #1474: MINIFICPP-2008 Differentiate successful onTriggers from throwing onTr…

Posted by "adamdebreceni (via GitHub)" <gi...@apache.org>.
adamdebreceni closed pull request #1474: MINIFICPP-2008 Differentiate successful onTriggers from throwing onTr…
URL: https://github.com/apache/nifi-minifi-cpp/pull/1474


-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi-minifi-cpp] martinzink commented on a diff in pull request #1474: MINIFICPP-2008 Differentiate successful onTriggers from throwing onTr…

Posted by "martinzink (via GitHub)" <gi...@apache.org>.
martinzink commented on code in PR #1474:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1474#discussion_r1085109599


##########
libminifi/include/SchedulingAgent.h:
##########
@@ -90,14 +86,15 @@ class SchedulingAgent {
     logger_->log_trace("Destroying scheduling agent");
   }
 
-  // onTrigger, return whether the yield is need
-  bool onTrigger(core::Processor* processor, const std::shared_ptr<core::ProcessContext> &processContext, const std::shared_ptr<core::ProcessSessionFactory> &sessionFactory);
-  // start
+  nonstd::expected<void, std::exception_ptr> onTrigger(core::Processor* processor,
+                                                       const std::shared_ptr<core::ProcessContext>& process_context,
+                                                       const std::shared_ptr<core::ProcessSessionFactory>& session_factory);

Review Comment:
   sry for the late reply I've fixed this alignment in https://github.com/apache/nifi-minifi-cpp/pull/1474/commits/fa5f54e54592e0ec7c4c46fdebe40d1ed559d56d



##########
libminifi/include/CronDrivenSchedulingAgent.h:
##########
@@ -45,8 +45,6 @@ class CronDrivenSchedulingAgent : public ThreadedSchedulingAgent {
       : ThreadedSchedulingAgent(controller_service_provider, std::move(repo), std::move(flow_repo), std::move(content_repo), std::move(configuration), thread_pool) {
   }
 
-  CronDrivenSchedulingAgent(const CronDrivenSchedulingAgent& parent) = delete;
-  CronDrivenSchedulingAgent& operator=(const CronDrivenSchedulingAgent& parent) = delete;

Review Comment:
   No, this is already disabled in the parent class see related conversation: https://github.com/apache/nifi-minifi-cpp/pull/1474#discussion_r1049662610



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi-minifi-cpp] szaszm commented on a diff in pull request #1474: MINIFICPP-2008 Differentiate successful onTriggers from throwing onTr…

Posted by "szaszm (via GitHub)" <gi...@apache.org>.
szaszm commented on code in PR #1474:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1474#discussion_r1085117807


##########
libminifi/include/CronDrivenSchedulingAgent.h:
##########
@@ -45,8 +45,6 @@ class CronDrivenSchedulingAgent : public ThreadedSchedulingAgent {
       : ThreadedSchedulingAgent(controller_service_provider, std::move(repo), std::move(flow_repo), std::move(content_repo), std::move(configuration), thread_pool) {
   }
 
-  CronDrivenSchedulingAgent(const CronDrivenSchedulingAgent& parent) = delete;
-  CronDrivenSchedulingAgent& operator=(const CronDrivenSchedulingAgent& parent) = delete;

Review Comment:
   I don't think it's a bad thing to repeat the copy/move deletion in derived classes, because it provides more information locally, but it's fine like this as well.



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org