Class EnforceOrder
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.EnforceOrder
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@Tags({"sort","order"})
@InputRequirement(INPUT_REQUIRED)
@TriggerSerially
@CapabilityDescription("Enforces expected ordering of FlowFiles that belong to the same data group within a single node. Although PriorityAttributePrioritizer can be used on a connection to ensure that flow files going through that connection are in priority order, depending on error-handling, branching, and other flow designs, it is possible for FlowFiles to get out-of-order. EnforceOrder can be used to enforce original ordering for those FlowFiles. [IMPORTANT] In order to take effect of EnforceOrder, FirstInFirstOutPrioritizer should be used at EVERY downstream relationship UNTIL the order of FlowFiles physically get FIXED by operation such as MergeContent or being stored to the final destination.")
@Stateful(scopes=LOCAL,
description="EnforceOrder uses following states per ordering group: \'<groupId>.target\' is a order number which is being waited to arrive next. When a FlowFile with a matching order arrives, or a FlowFile overtakes the FlowFile being waited for because of wait timeout, target order will be updated to (FlowFile.order + 1). \'<groupId>.max is the maximum order number for a group. \'<groupId>.updatedAt\' is a timestamp when the order of a group was updated last time. These managed states will be removed automatically once a group is determined as inactive, see \'Inactive Timeout\' for detail.")
@WritesAttribute(attribute="EnforceOrder.startedAt",description="All FlowFiles going through this processor will have this attribute. This value is used to determine wait timeout.") @WritesAttribute(attribute="EnforceOrder.result",description="All FlowFiles going through this processor will have this attribute denoting which relationship it was routed to.") @WritesAttribute(attribute="EnforceOrder.detail",description="FlowFiles routed to \'failure\' or \'skipped\' relationship will have this attribute describing details.") @WritesAttribute(attribute="EnforceOrder.expectedOrder",description="FlowFiles routed to \'wait\' or \'skipped\' relationship will have this attribute denoting expected order when the FlowFile was processed.")
public class EnforceOrder
extends org.apache.nifi.processor.AbstractProcessor
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic 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.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.Relationshipstatic final org.apache.nifi.processor.Relationshipprivate static final Set<org.apache.nifi.processor.Relationship> private static final Stringstatic final org.apache.nifi.components.PropertyDescriptor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext) Set<org.apache.nifi.processor.Relationship> protected List<org.apache.nifi.components.PropertyDescriptor> 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
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
-
ATTR_STARTED_AT
- See Also:
-
ATTR_EXPECTED_ORDER
- See Also:
-
ATTR_RESULT
- See Also:
-
ATTR_DETAIL
- See Also:
-
STATE_TARGET_ORDER
-
STATE_SUFFIX_UPDATED_AT
- See Also:
-
STATE_UPDATED_AT
-
STATE_MAX_ORDER
-
GROUP_IDENTIFIER
public static final org.apache.nifi.components.PropertyDescriptor GROUP_IDENTIFIER -
ORDER_ATTRIBUTE
public static final org.apache.nifi.components.PropertyDescriptor ORDER_ATTRIBUTE -
INITIAL_ORDER
public static final org.apache.nifi.components.PropertyDescriptor INITIAL_ORDER -
MAX_ORDER
public static final org.apache.nifi.components.PropertyDescriptor MAX_ORDER -
WAIT_TIMEOUT
public static final org.apache.nifi.components.PropertyDescriptor WAIT_TIMEOUT -
INACTIVE_TIMEOUT
public static final org.apache.nifi.components.PropertyDescriptor INACTIVE_TIMEOUT -
BATCH_COUNT
public static final org.apache.nifi.components.PropertyDescriptor BATCH_COUNT -
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_OVERTOOK
public static final org.apache.nifi.processor.Relationship REL_OVERTOOK -
REL_SKIPPED
public static final org.apache.nifi.processor.Relationship REL_SKIPPED -
RELATIONSHIPS
-
-
Constructor Details
-
EnforceOrder
public EnforceOrder()
-
-
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
-
customValidate
protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext) - Overrides:
customValidatein classorg.apache.nifi.components.AbstractConfigurableComponent
-
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
-