[ 
https://issues.apache.org/jira/browse/NIFI-1526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15549960#comment-15549960
 ] 

ASF GitHub Bot commented on NIFI-1526:
--------------------------------------

Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1107#discussion_r82070839
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
 ---
    @@ -187,6 +187,50 @@ public StandardProcessorNode(final Processor 
processor, final String uuid,
             }
     
             schedulingStrategy = SchedulingStrategy.TIMER_DRIVEN;
    +        try
    +        {
    +
    +            if(procClass.isAnnotationPresent(DefaultSchedule.class))
    +            {
    +                DefaultSchedule dsc = 
procClass.getAnnotation(DefaultSchedule.class);
    +                try
    +                {
    +                    this.setSchedulingStrategy(dsc.Strategy());
    +                }
    +                catch (Throwable ex)
    +                {
    +                    LOG.error(String.format("Error while setting 
scheduling strategy from DefaultSchedule annotation: %s",ex.getMessage()));
    --- End diff --
    
    When logging exceptions, you could add the exception as second argument of 
the logging method, this will display the full stacktrace in the logs and that 
can be quite useful.
    ````java
    LOG.error(String.format("Error while setting scheduling strategy from 
DefaultSchedule annotation: %s",ex.getMessage()), ex);
    ````


> Allow components to provide default values for Yield Duration and Run Schedule
> ------------------------------------------------------------------------------
>
>                 Key: NIFI-1526
>                 URL: https://issues.apache.org/jira/browse/NIFI-1526
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Bryan Bende
>            Priority: Minor
>
> It would be nice for developers of processors (and maybe reporting tasks and 
> controller services) to be able to specify a default value for Yield duration 
> and Run Schedule.
> Currently Yield defaults to 1 second and Run Schedule defaults to 0 seconds. 
> There may be cases where these are not the best default values and the 
> developer wants to start off with better defaults, still allowing the user to 
> tune as needed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to