@SideEffectFree @TriggerSerially @InputRequirement(value=INPUT_REQUIRED) @Tags(value={"rate control","throttle","rate","throughput"}) @CapabilityDescription(value="Controls the rate at which data is transferred to follow-on processors. If you configure a very small Time Duration, then the accuracy of the throttle gets worse. You can improve this accuracy by decreasing the Yield Duration, at the expense of more Tasks given to the processor.") public class ControlRate extends AbstractProcessor
Modifier and Type | Class and Description |
---|---|
private static class |
ControlRate.Throttle |
private class |
ControlRate.ThrottleFilter |
Constructor and Description |
---|
ControlRate() |
Modifier and Type | Method and Description |
---|---|
protected Collection<ValidationResult> |
customValidate(ValidationContext context) |
private long |
getFlowFileAccrual(FlowFile flowFile) |
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
protected void |
init(ProcessorInitializationContext context) |
void |
onPropertyModified(PropertyDescriptor descriptor,
String oldValue,
String newValue) |
void |
onScheduled(ProcessContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, validate
public static final String DATA_RATE
public static final String FLOWFILE_RATE
public static final String ATTRIBUTE_RATE
public static final AllowableValue DATA_RATE_VALUE
public static final AllowableValue FLOWFILE_RATE_VALUE
public static final AllowableValue ATTRIBUTE_RATE_VALUE
public static final int MAX_FLOW_FILES_PER_BATCH
public static final PropertyDescriptor RATE_CONTROL_CRITERIA
public static final PropertyDescriptor MAX_RATE
public static final PropertyDescriptor RATE_CONTROL_ATTRIBUTE_NAME
public static final PropertyDescriptor TIME_PERIOD
public static final PropertyDescriptor GROUPING_ATTRIBUTE_NAME
public static final Relationship REL_SUCCESS
public static final Relationship REL_FAILURE
private static final Pattern POSITIVE_LONG_PATTERN
private static final String DEFAULT_GROUP_ATTRIBUTE
private List<PropertyDescriptor> properties
private Set<Relationship> relationships
private final ConcurrentMap<String,ControlRate.Throttle> throttleMap
private final AtomicLong lastThrottleClearTime
private volatile String rateControlCriteria
private volatile String rateControlAttribute
private volatile String maximumRateStr
private volatile String groupingAttributeName
private volatile int timePeriodSeconds
protected void init(ProcessorInitializationContext context)
init
in class AbstractSessionFactoryProcessor
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
protected Collection<ValidationResult> customValidate(ValidationContext context)
customValidate
in class AbstractConfigurableComponent
public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue)
onPropertyModified
in interface ConfigurableComponent
onPropertyModified
in class AbstractConfigurableComponent
@OnScheduled public void onScheduled(ProcessContext context)
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException
private long getFlowFileAccrual(FlowFile flowFile)
Copyright © 2017 Apache NiFi Project. All rights reserved.