[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-11-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1526:
--

Github user asfgit closed the pull request at:

https://github.com/apache/nifi/pull/1107


> 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
> Fix For: 1.1.0
>
>
> 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)


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-11-14 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on NIFI-1526:
---

Commit b0f6825e09caa94b0aa03b9c9611ec3f5ce0ac7b in nifi's branch 
refs/heads/master from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=b0f6825 ]

NIFI-1526: This closes #1107.


> 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
> Fix For: 1.1.0
>
>
> 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)


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-11-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1526:
--

Github user markap14 commented on the issue:

https://github.com/apache/nifi/pull/1107
  
@mathiastiberghien this is great work - sorry it took so long to get this 
reviewed. All looks good, though. I have merged to master and will close the 
JIRA as fixed. Thanks for the contribution!


> 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
> Fix For: 1.1.0
>
>
> 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)


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-11-14 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on NIFI-1526:
---

Commit 65b7b377e3072b83f75e63b053a4f080726d824d in nifi's branch 
refs/heads/master from [~mathiastiberghien]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=65b7b37 ]

NIFI-1526: DefaultSchedule annotation should be use on Custom Processor to set 
the default scheduling strategy, scheduling period or max number of concurrent 
task for each instance of the processor
DefaultSettings annotation should be use on Custom Processor to set the default 
penalty period, the yield duration or the bulletin log level for each instance 
of the processor


> 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
> Fix For: 1.1.0
>
>
> 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)


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-11-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1526:
--

Github user markap14 commented on the issue:

https://github.com/apache/nifi/pull/1107
  
@mathiastiberghien my apologies. I didn't see where @pvillard31 had 
mentioned me. I'll review now & if all is good will merge to master this 
afternoon. Thanks!


> 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
> Fix For: 1.1.0
>
>
> 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)


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-11-14 Thread Joseph Witt (JIRA)

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

Joseph Witt commented on NIFI-1526:
---

[~mathiastiberghien] thanks for contributing and following up.  I've just 
tagged it to the 1.1.0 release to help put some attention on it.  The quick 
scan I did through the code looks good.  I do think we'll want to update the 
developer guide to describe that this exists and also explain that it is for a 
developer to communicate their recommended typical setting and that users can 
still alter it as necessary.  But that can be in another JIRA and come later in 
my opinion.

There is a merge conflict now.  Could you try resolving that?

[~markap14] any chance you can take a look?  

> 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
> Fix For: 1.1.0
>
>
> 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)


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-11-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1526:
--

Github user mathiastiberghien commented on the issue:

https://github.com/apache/nifi/pull/1107
  
Hello, it seems that the pull request remains blocked. Should I change 
something?


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


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-10-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1526:
--

Github user pvillard31 commented on the issue:

https://github.com/apache/nifi/pull/1107
  
LGTM +1 run a full build with contrib check and visually verified code.
@markap14 do you want to have another look?


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


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-10-13 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1526:
--

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

https://github.com/apache/nifi/pull/1107#discussion_r83271823
  
--- Diff: 
nifi-api/src/main/java/org/apache/nifi/annotation/configuration/DefaultSettings.java
 ---
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.nifi.annotation.configuration;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Inherited;
+import org.apache.nifi.logging.LogLevel;
+
+/**
+ * 
+ * Marker interface that a Processor can use to configure the yield 
duration, the  penalty duration and the bulletin log level.
+ * Note that the number of Concurrent tasks will be ignored if the 
annotion @TriggerSerialy is used
+ * 
+ */
+@Documented
+@Target({ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+public @interface DefaultSettings {
+String yieldDuration() default "1 sec";
+String penaltyDuration() default "30 sec";
+LogLevel logLevel() default LogLevel.WARN;
--- End diff --

This should probably be called bulletinLevel, rather than logLevel. The 
processor can log at any level it wants - this controls which level is shown as 
a bulletin.


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


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-10-10 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1526:
--

Github user mathiastiberghien commented on the issue:

https://github.com/apache/nifi/pull/1107
  
Hi,
I finally could build running all tests on my computer. I understood the 
licence header system and also that my repository shouldn't contain space 
otherwhise a lot o tests are failing.
This last commit should be ok, because it passes mvn clean install 
-Pcontrib-check for nifi-api and nifi-framework-core projects.

Next contribution first commit should better!


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


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-10-10 Thread Mathias Tiberghien (JIRA)

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

Mathias Tiberghien commented on NIFI-1526:
--

Hi, when I try the command clean install -Pcontrib-check I've got the following 
errors:
[ERROR] Failed to execute goal org.apache.rat:apache-rat-plugin:0.11:check 
(default) on project nifi-api: Too many files with unapproved license: 2 See 
RAT report in: D:\idea projects\git\nifi\nifi-api\target\rat.txt -> [Help 1]
Reading the rat.txt file it appears that the files I have created are marked 
with unknown licence.
How do I fix this? Should I update a config file or something?
Thanks

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


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-10-08 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1526:
--

Github user mathiastiberghien commented on the issue:

https://github.com/apache/nifi/pull/1107
  
Sorry for the 2 commits but I realise that lowercasing the methods in 
annotations changes a lot of files. I should have check before to commit but 
I'm really used to Visual Studio renaming a method only rename the method...


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


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1526:
--

Github user mathiastiberghien commented on the issue:

https://github.com/apache/nifi/pull/1107
  
I'll correct styles (I'm really newbie to java and open source).
I add issues to launch the styles tests so  I hope I won't miss anything.
Sorry for the undesired change. I had to put a hard code reference because
the generated path failed (too long?). I made a mistake reverting code and
I'll fix it

Le 7 oct. 2016 19:49, "Pierre Villard"  a écrit :

> *@pvillard31* requested changes on this pull request.
>
> Hi @mathiastiberghien , thanks for
> the additional work!
>
> Still some checkstyle issues:
>
> [WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1066:13] (blocks) 
LeftCurly: '{' should be on the previous line.
> [WARNING] 
src/test/java/org/apache/nifi/controller/TestFlowController.java[50] (imports) 
AvoidStarImport: Using the '.*' form of import should be avoided - 
org.apache.nifi.processor.*.
>
> Besides, could you remove the use of '_' in classes name and variables
> name. This is not very Java stylish :) (unless some specific cases such as
> final static variables). Also in your annotations, could you avoid 
starting
> methods name with a capital letter?
>
> I agree all of this could be checked through our checkstyle configuration
> (and I'll have a look at this) but I make those remarks to ensure some
> consistency in the code.
>
> Otherwise thanks for the unit tests!
> --
>
> In nifi-nar-bundles/nifi-framework-bundle/nifi-
> framework/nifi-framework-core/src/test/java/org/apache/nifi/
> controller/TestFlowController.java
> :
>
> > @@ -71,7 +74,7 @@
>
>  @Before
>  public void setup() {
> -System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, 
TestFlowController.class.getResource("/nifi.properties").getFile());
> +System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, 
FlowController.class.getResource("/nifi.properties").getFile());
>
> Is it really needed?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> , or 
mute
> the thread
> 

> .
>



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


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-10-07 Thread ASF GitHub Bot (JIRA)

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

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_r82437230
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestFlowController.java
 ---
@@ -71,7 +74,7 @@
 
 @Before
 public void setup() {
-System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, 
TestFlowController.class.getResource("/nifi.properties").getFile());
+System.setProperty(NiFiProperties.PROPERTIES_FILE_PATH, 
FlowController.class.getResource("/nifi.properties").getFile());
--- End diff --

Is it really needed?


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


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1526:
--

Github user mathiastiberghien commented on the issue:

https://github.com/apache/nifi/pull/1107
  
I've been able to find the problem with Dummy processors (the class were 
declared in the test file which created an InstanciationException).
So I commited the code with style corrections, exceptions added to Log 
methods to have the stack trace, and 2 tests added to the TestFlowController 
class testing each annotation


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


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1526:
--

Github user mathiastiberghien commented on the issue:

https://github.com/apache/nifi/pull/1107
  
Hello,

Thanks for the comments.

I have a question about unit test: I need to test the method 
createProcessor of the FlowController so I guess I need to update the 
TestFlowController file adding a method that add some dummy processors and 
check the behavior.

 

How do I proceed to add my dummy processors class to the system, because 
createProcessor method requires the type and the identifier (which is?)

 

I’ve trie to create a dummy class processor and use class.forname method 
but it didn’t work

 

 

Mathias TIBERGHIEN

CTO

Cell. : +33(0)6 27 58 13 68

  

87 Bd Chanzy

93100 Montreuil

France

 

Tel : +33(0)1 42 87 16 57

www.code192.com  

 

From: Pierre Villard [mailto:notificati...@github.com] 
Sent: mercredi 5 octobre 2016 23:11
To: apache/nifi 
Cc: Mathias Tiberghien ; Author 

Subject: Re: [apache/nifi] origin/NIFI-1526 (#1107)

 

@pvillard31 requested changes on this pull request.

Few preliminary stylish remarks.
I would also love to see some unit tests in nifi-framework-core with dummy 
processors to confirm the good behavior of the annotations.
In any case, this will be a useful improvement, thanks for contributing!

  _  

In 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
  :

> @@ -1059,6 +1060,42 @@ public ProcessorNode createProcessor(final String 
type, String id, final boolean
 final LogRepository logRepository = 
LogRepositoryFactory.getRepository(id);
 
logRepository.addObserver(StandardProcessorNode.BULLETIN_OBSERVER_ID, 
LogLevel.WARN, new ProcessorLogObserver(getBulletinRepository(), procNode));
 
+try {
+
+final Class procClass = processor.getClass();
+if(procClass.isAnnotationPresent(DefaultSettings.class))
+{

There are checkstyle violations to fix:

[WARNING] 
src/main/java/org/apache/nifi/annotation/configuration/DefaultSchedule.java[5] 
(imports) AvoidStarImport: Using the '.*' form of import should be avoided - 
java.lang.annotation.*.
[WARNING] 
src/main/java/org/apache/nifi/annotation/configuration/DefaultSettings.java[5] 
(imports) AvoidStarImport: Using the '.*' form of import should be avoided - 
java.lang.annotation.*.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1067:13] (blocks) 
LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1071:17] (blocks) 
RightCurly: '}' should be on the same line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1073:17] (blocks) 
LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1079:17] (blocks) 
RightCurly: '}' should be on the same line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1081:17] (blocks) 
LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1086:17] (blocks) 
RightCurly: '}' should be on the same line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1088:17] (blocks) 
LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1093:9] (blocks) 
RightCurly: '}' should be on the same line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1095:9] (blocks) 
LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[191:9] 
(blocks) LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[194:13] 
(blocks) LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[197:17] 
(blocks) LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[199:17] 
(blocks) RightCurly: '}' should be on the same line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[201:17] 
(blocks) LeftCurly: '{' should be on the previous line.
[

[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-10-05 Thread ASF GitHub Bot (JIRA)

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

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_r8207
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
 ---
@@ -1059,6 +1060,42 @@ public ProcessorNode createProcessor(final String 
type, String id, final boolean
 final LogRepository logRepository = 
LogRepositoryFactory.getRepository(id);
 
logRepository.addObserver(StandardProcessorNode.BULLETIN_OBSERVER_ID, 
LogLevel.WARN, new ProcessorLogObserver(getBulletinRepository(), procNode));
 
+try {
+
+final Class procClass = processor.getClass();
+if(procClass.isAnnotationPresent(DefaultSettings.class))
+{
--- End diff --

There are checkstyle violations to fix:

[WARNING] 
src/main/java/org/apache/nifi/annotation/configuration/DefaultSchedule.java[5] 
(imports) AvoidStarImport: Using the '.*' form of import should be avoided - 
java.lang.annotation.*.
[WARNING] 
src/main/java/org/apache/nifi/annotation/configuration/DefaultSettings.java[5] 
(imports) AvoidStarImport: Using the '.*' form of import should be avoided - 
java.lang.annotation.*.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1067:13] (blocks) 
LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1071:17] (blocks) 
RightCurly: '}' should be on the same line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1073:17] (blocks) 
LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1079:17] (blocks) 
RightCurly: '}' should be on the same line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1081:17] (blocks) 
LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1086:17] (blocks) 
RightCurly: '}' should be on the same line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1088:17] (blocks) 
LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1093:9] (blocks) 
RightCurly: '}' should be on the same line.
[WARNING] 
src/main/java/org/apache/nifi/controller/FlowController.java[1095:9] (blocks) 
LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[191:9] 
(blocks) LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[194:13] 
(blocks) LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[197:17] 
(blocks) LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[199:17] 
(blocks) RightCurly: '}' should be on the same line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[201:17] 
(blocks) LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[205:17] 
(blocks) LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[207:17] 
(blocks) RightCurly: '}' should be on the same line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[209:17] 
(blocks) LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[214:17] 
(blocks) LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[216:21] 
(blocks) LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[218:21] 
(blocks) RightCurly: '}' should be on the same line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[220:21] 
(blocks) LeftCurly: '{' should be on the previous line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[226:9] 
(blocks) RightCurly: '}' should be on the same line.
[WARNING] 
src/main/java/org/apache/nifi/controller/StandardProcessorNode.java[228:9] 
(blocks) LeftCurly: '{' should be on the previous line.


You can check it by yourself by running:

mvn clean install -Pcontrib-check



[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-10-05 Thread ASF GitHub Bot (JIRA)

[ 
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)


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-10-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on NIFI-1526:
--

GitHub user mathiastiberghien opened a pull request:

https://github.com/apache/nifi/pull/1107

origin/NIFI-1526

This commit solves the issue 1526 adding DefaultSchedule and 
DefaultSettings annotation to the nifi-api
This annotations are then use on Custom Processor classes and allows the 
developer to configure the default
schedule (scheduling strategy, scheduling period, max concurrent tasks) and 
settings (yield duration, penalty period, bulletin log level)
for the processor.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/mathiastiberghien/nifi origin/NIFI-1526

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/1107.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1107


commit df223a71afd34b75ca2d0e8cfaabc045de6c09dd
Author: Mathias Tiberghien 
Date:   2016-10-05T15:50:08Z

1 first commit for feature NIFI-1526
DefaultSchedule annotation should be use on Custom Processor to set the 
default scheduling strategy, scheduling period or max number of concurrent task 
for each instance of the processor
DefaultSettings annotation should be use on Custom Processor to set the 
default penalty period, the yield duration or the bulletin log level for each 
instance of the processor




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


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-10-05 Thread Bryan Bende (JIRA)

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

Bryan Bende commented on NIFI-1526:
---

[~mathiastiberghien] The typical approach that people have been using is the 
following...
- Fork Apache NiFi on GitHub
- Clone your fork so that you have it locally
- Create a local branch on your fork like NIFI-1526
- Do your work and commit to that branch
- When done, push that branch to your remote fork by doing "git push -u origin 
NIFI-1526"
- Then go to your fork on GitHub and and create a pull request from your 
NIFI-1526 branch to Apache NIFi master 

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


[jira] [Commented] (NIFI-1526) Allow components to provide default values for Yield Duration and Run Schedule

2016-10-05 Thread Mathias Tiberghien (JIRA)

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

Mathias Tiberghien commented on NIFI-1526:
--

Hi, it's my first contribution here. I have worked on the master locally and 
added two annotations in nifi-api: DefaultSchedule and DefaultSettings and 
modified FlowController and StandardProcessorNode. I've been able to compile 
and test it without issues. But I still haven't commit it because I'm not sure 
yet how to do it correctly (I have create a local branche named origin/NIFI-1526

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