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

Mark Payne commented on NIFI-1339:
----------------------------------

Unfortunately, the documentation for the onPropertyModified method does not 
address what will happen upon restart of NiFi. The issue that concerns me with 
changing this is that many Processors, such as RouteOnAttribute (and any other 
Processors that have 'dynamic' relationships) will likely not function properly 
if this is changed.

As-is, though, some Processors, such as ListHDFS do not function properly, as 
they will clear the state about what has already been listed if the Directory 
to list is changed. This means that on restart, the state is lost and all files 
begin being listed again.

Perhaps a reasonable approach here is to introduce a new 
@OnConfigurationRestored annotation. Then, Processors would know when the 
configuration has been restored and ListHDFS (and similar processors) can reset 
state only if a property is changed and the configuration has already been 
restored. Using this approach, any method annotated with 
@OnConfigurationRestored should be called immediately when a new Processor is 
added to the graph (since there is no configuration to restore), and on restart 
after all properties and annotation data has been set.

> Framework calls onPropertyModified for each property each time NiFi is started
> ------------------------------------------------------------------------------
>
>                 Key: NIFI-1339
>                 URL: https://issues.apache.org/jira/browse/NIFI-1339
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Mark Payne
>             Fix For: 0.5.0
>
>
> When NiFi is started, it sets all properties for each Controller Service, 
> Reporting Task, and Processor. If any property is not set to the default 
> value, this will trigger onPropertyModified to get called. However, this 
> method should be called ONLY if the property is changed. Since we are not 
> really changing the property value (only restoring it to the proper value), 
> we should never call this method during startup.



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

Reply via email to