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

    https://github.com/apache/nifi/pull/2429#discussion_r175185294
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LogarithmicallyPenalizeFlowFileProcessor.java
 ---
    @@ -0,0 +1,122 @@
    +package org.apache.nifi.processors.standard;
    +
    +import java.util.Arrays;
    +import java.util.HashSet;
    +import java.util.List;
    +import java.util.Set;
    +
    +import org.apache.nifi.components.PropertyDescriptor;
    +import org.apache.nifi.components.ValidationContext;
    +import org.apache.nifi.components.ValidationResult;
    +import org.apache.nifi.components.Validator;
    +import org.apache.nifi.flowfile.FlowFile;
    +import org.apache.nifi.processor.AbstractProcessor;
    +import org.apache.nifi.processor.ProcessContext;
    +import org.apache.nifi.processor.ProcessSession;
    +import org.apache.nifi.processor.Relationship;
    +import org.apache.nifi.processor.util.StandardValidators;
    +
    +public class LogarithmicallyPenalizeFlowFileProcessor extends 
AbstractProcessor {
    +
    +    private static final PropertyDescriptor INITIAL_RECONNECT_TIMEOUT = 
new PropertyDescriptor.Builder()
    +            .name("initialReconnectTimeout")
    +            .displayName("InitialReconnectTimeoutMs")
    +            .description("First delay length after first FlowFile arrival 
in millis")
    +            .defaultValue("50")
    +            .required(true)
    +            .expressionLanguageSupported(false)
    +            .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
    +            .build();
    +
    +    private static final PropertyDescriptor MAXIMAL_RECONNECT_TIMEOUT = 
new PropertyDescriptor.Builder()
    +            .name("maximalReconnectTimeout")
    +            .displayName("MaximalReconnectTimeoutMs")
    +            .description("Maximal delay length after first FlowFile 
arrival in millis")
    +            .defaultValue(""+10*60*1000)//10 minutes
    +            .required(true)
    +            .expressionLanguageSupported(false)
    +            .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
    +            .build();
    +
    +    private static final PropertyDescriptor MAXIMAL_NUMBER_OF_RETRIES = 
new PropertyDescriptor.Builder()
    +            .name("maximalNumberOfRetries")
    +            .displayName("maximalNumberOfRetries")
    +            .description("Maximal number of retries to allow")
    +            .defaultValue("10")
    +            .required(true)
    +            .expressionLanguageSupported(false)
    +            .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
    +            .build();
    +
    +    private static final PropertyDescriptor RETRY_COUNT_PROPERTY = new 
PropertyDescriptor.Builder()
    +            .name("retryCountProperty")
    +            .displayName("RetryCountProperty")
    +            .description("Name of attribute in which number of retries 
should be stored.")
    +            .required(true)
    +            .expressionLanguageSupported(false)
    +            .addValidator(new Validator() {
    --- End diff --
    
    We should use a NON_EMPTY_VALIDATOR here.


---

Reply via email to