You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by mattyb149 <gi...@git.apache.org> on 2016/12/06 18:32:03 UTC

[GitHub] nifi pull request #319: NIFI-1582 added state to UpdateAttribute as well as ...

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

    https://github.com/apache/nifi/pull/319#discussion_r91141036
  
    --- Diff: nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/src/main/java/org/apache/nifi/processors/attributes/UpdateAttribute.java ---
    @@ -162,20 +146,33 @@ public ValidationResult validate(String subject, String input, ValidationContext
         // static properties
         public static final PropertyDescriptor DELETE_ATTRIBUTES = new PropertyDescriptor.Builder()
                 .name("Delete Attributes Expression")
    -            .description("Regular expression for attributes to be deleted from flowfiles.")
    +            .description("Regular expression for attributes to be deleted from FlowFiles.")
                 .required(false)
                 .addValidator(DELETE_PROPERTY_VALIDATOR)
                 .expressionLanguageSupported(true)
                 .build();
     
    -    // relationships
    -    public static final Relationship REL_SUCCESS = new Relationship.Builder()
    -            .description("All FlowFiles are routed to this relationship").name("success").build();
    +    public static final PropertyDescriptor STORE_STATE = new PropertyDescriptor.Builder()
    +            .name("Store State")
    +            .description("Select whether or not state will be stored. Selecting 'Stateless' will offer the default functionality of purely updating the attributes on a " +
    +                    "FlowFile in a stateless manner. Selecting 'Stateful' will not only store the attributes on the FlowFile but also in the Processors state. See the 'Stateful Usage' " +
    +                    "topic of the 'Additional Details' section of this processor's documentation for more information")
    +            .required(true)
    +            .allowableValues(DO_NOT_STORE_STATE, STORE_STATE_LOCALLY)
    +            .defaultValue(DO_NOT_STORE_STATE)
    +            .build();
    +    public static final PropertyDescriptor STATEFUL_VARIABLES_INIT_VALUE = new PropertyDescriptor.Builder()
    +            .name("Stateful Variables Initial Value")
    +            .description("If using state to set/reference variables then this value is used to set the initial value of the stateful variable. This will only be used in the @OnScheduled method " +
    +                    "when state does not contain a value for the variable.")
    +            .required(false)
    +            .defaultValue("0")
    --- End diff --
    
    Should this be empty rather than zero? Seems like many of the use cases are numeric in nature so I see the value of a zero default, but wondering for the most general case if it should default to empty. I'm fine either way, just wanted your thoughts on it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---