Class Wait
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.Wait
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@SupportsBatching
@Tags({"map","cache","wait","hold","distributed","signal","release"})
@InputRequirement(INPUT_REQUIRED)
@CapabilityDescription("Routes incoming FlowFiles to the \'wait\' relationship until a matching release signal is stored in the distributed cache from a corresponding Notify processor. When a matching release signal is identified, a waiting FlowFile is routed to the \'success\' relationship. The release signal entry is then removed from the cache. The attributes of the FlowFile that produced the release signal are copied to the waiting FlowFile if the Attribute Cache Regex property of the corresponding Notify processor is set properly. If there are multiple release signals in the cache identified by the Release Signal Identifier, and the Notify processor is configured to copy the FlowFile attributes to the cache, then the FlowFile passing the Wait processor receives the union of the attributes of the FlowFiles that produced the release signals in the cache (identified by Release Signal Identifier). Waiting FlowFiles will be routed to \'expired\' if they exceed the Expiration Duration. If you need to wait for more than one signal, specify the desired number of signals via the \'Target Signal Count\' property. This is particularly useful with processors that split a source FlowFile into multiple fragments, such as SplitText. In order to wait for all fragments to be processed, connect the \'original\' relationship to a Wait processor, and the \'splits\' relationship to a corresponding Notify processor. Configure the Notify and Wait processors to use the \'${fragment.identifier}\' as the value of \'Release Signal Identifier\', and specify \'${fragment.count}\' as the value of \'Target Signal Count\' in the Wait processor.It is recommended to use a prioritizer (for instance First In First Out) when using the \'wait\' relationship as a loop.")
@WritesAttribute(attribute="wait.start.timestamp",description="All FlowFiles will have an attribute \'wait.start.timestamp\', which sets the initial epoch timestamp when the file first entered this processor. This is used to determine the expiration time of the FlowFile. This attribute is not written when the FlowFile is transferred to failure, expired or success") @WritesAttribute(attribute="wait.counter.<counterName>",description="The name of each counter for which at least one signal has been present in the cache since the last time the cache was empty gets copied to the current FlowFile as an attribute.")
@SeeAlso(classNames={"org.apache.nifi.distributed.cache.client.DistributedMapCacheClientService","org.apache.nifi.distributed.cache.server.map.DistributedMapCacheServer","org.apache.nifi.processors.standard.Notify"})
public class Wait
extends org.apache.nifi.processor.AbstractProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.nifi.components.AllowableValuestatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.AllowableValuestatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprivate static final List<org.apache.nifi.components.PropertyDescriptor> static final org.apache.nifi.processor.Relationshipstatic final org.apache.nifi.processor.Relationshipstatic final org.apache.nifi.processor.Relationshipstatic final org.apache.nifi.processor.Relationshipprivate static final Set<org.apache.nifi.processor.Relationship> static final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.AllowableValuestatic final org.apache.nifi.components.AllowableValuestatic final org.apache.nifi.components.PropertyDescriptorstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.nifi.flowfile.FlowFileclearWaitState(org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile flowFile) private org.apache.nifi.flowfile.FlowFilecopySignalAttributes(org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile flowFile, WaitNotifyProtocol.Signal signal, Map<String, Long> originalCount, boolean replaceOriginal) Set<org.apache.nifi.processor.Relationship> protected List<org.apache.nifi.components.PropertyDescriptor> voidonStopped(org.apache.nifi.processor.ProcessContext context) voidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) Methods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateProperties, migrateRelationships
-
Field Details
-
WAIT_START_TIMESTAMP
- See Also:
-
DISTRIBUTED_CACHE_SERVICE
public static final org.apache.nifi.components.PropertyDescriptor DISTRIBUTED_CACHE_SERVICE -
RELEASE_SIGNAL_IDENTIFIER
public static final org.apache.nifi.components.PropertyDescriptor RELEASE_SIGNAL_IDENTIFIER -
TARGET_SIGNAL_COUNT
public static final org.apache.nifi.components.PropertyDescriptor TARGET_SIGNAL_COUNT -
SIGNAL_COUNTER_NAME
public static final org.apache.nifi.components.PropertyDescriptor SIGNAL_COUNTER_NAME -
WAIT_BUFFER_COUNT
public static final org.apache.nifi.components.PropertyDescriptor WAIT_BUFFER_COUNT -
RELEASABLE_FLOWFILE_COUNT
public static final org.apache.nifi.components.PropertyDescriptor RELEASABLE_FLOWFILE_COUNT -
EXPIRATION_DURATION
public static final org.apache.nifi.components.PropertyDescriptor EXPIRATION_DURATION -
ATTRIBUTE_COPY_REPLACE
public static final org.apache.nifi.components.AllowableValue ATTRIBUTE_COPY_REPLACE -
ATTRIBUTE_COPY_KEEP_ORIGINAL
public static final org.apache.nifi.components.AllowableValue ATTRIBUTE_COPY_KEEP_ORIGINAL -
ATTRIBUTE_COPY_MODE
public static final org.apache.nifi.components.PropertyDescriptor ATTRIBUTE_COPY_MODE -
WAIT_MODE_TRANSFER_TO_WAIT
public static final org.apache.nifi.components.AllowableValue WAIT_MODE_TRANSFER_TO_WAIT -
WAIT_MODE_KEEP_IN_UPSTREAM
public static final org.apache.nifi.components.AllowableValue WAIT_MODE_KEEP_IN_UPSTREAM -
WAIT_MODE
public static final org.apache.nifi.components.PropertyDescriptor WAIT_MODE -
WAIT_PENALTY_DURATION
public static final org.apache.nifi.components.PropertyDescriptor WAIT_PENALTY_DURATION -
PROPERTY_DESCRIPTORS
-
REL_SUCCESS
public static final org.apache.nifi.processor.Relationship REL_SUCCESS -
REL_FAILURE
public static final org.apache.nifi.processor.Relationship REL_FAILURE -
REL_WAIT
public static final org.apache.nifi.processor.Relationship REL_WAIT -
REL_EXPIRED
public static final org.apache.nifi.processor.Relationship REL_EXPIRED -
RELATIONSHIPS
-
signalIdPenalties
-
-
Constructor Details
-
Wait
public Wait()
-
-
Method Details
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
onTrigger
public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException - Specified by:
onTriggerin classorg.apache.nifi.processor.AbstractProcessor- Throws:
org.apache.nifi.processor.exception.ProcessException
-
clearWaitState
private org.apache.nifi.flowfile.FlowFile clearWaitState(org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile flowFile) -
copySignalAttributes
private org.apache.nifi.flowfile.FlowFile copySignalAttributes(org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile flowFile, WaitNotifyProtocol.Signal signal, Map<String, Long> originalCount, boolean replaceOriginal) -
onStopped
@OnStopped public void onStopped(org.apache.nifi.processor.ProcessContext context) -
getSignalIdPenalties
-