Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-6678

Introduce a notion on `PropertyDescriptor` that indicates that any change to the property should reset component's state

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Core Framework
    • None

    Description

      We have several cases where Processor implement logic in `onPropertyModified` so that if a Property of interest has its value changed, we set a flag that indicates that state must be cleared. Then, in an `@OnScheduled` method, we clear the state as appropriate. This is problematic for a couple of reasons:

      1. It's easy to get the logic incorrect. If this is on in `onTrigger` for instance, it can result in state being inadvertently cleared when Primary Node changes.
      2. It's been implemented a few different times across different components, which means that clearing of the state may be a good feature to implement at the framework level.
      3. NIFI-2592 aims to address the fact that we call `@OnScheduled` method on nodes that are not the Primary Node. If this changes, the current algorithm will start to cause state to be inadvertently cleared.

      So, I recommend adding a new method to the `PropertyDescriptor.Builder`: 

      Builder clearStateOnChange(Scope... scope); 

      Then, a component can simply indicate in the Property Descriptor that any changes to the property value requires that the component's state be cleared. The given argument for `Scope` indicates whether LOCAL state, CLUSTER state, both, or neither should be cleared, defaulting to neither (an empty array).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              markap14 Mark Payne
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: