Class ForkRecord
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.ForkRecord
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@SideEffectFree
@SupportsBatching
@InputRequirement(INPUT_REQUIRED)
@Tags({"fork","record","content","array","stream","event"})
@CapabilityDescription("This processor allows the user to fork a record into multiple records. The user must specify at least one Record Path, as a dynamic property, pointing to a field of type ARRAY containing RECORD objects. The processor accepts two modes: \'split\' and \'extract\'. In both modes, there is one record generated per element contained in the designated array. In the \'split\' mode, each generated record will preserve the same schema as given in the input but the array will contain only one element. In the \'extract\' mode, the element of the array must be of record type and will be the generated record. Additionally, in the \'extract\' mode, it is possible to specify if each generated record should contain all the fields of the parent records from the root level to the extracted record. This assumes that the fields to add in the record are defined in the schema of the Record Writer controller service. See examples in the additional details documentation of this processor.")
@DynamicProperty(name="Record Path property",
value="The Record Path value",
expressionLanguageScope=FLOWFILE_ATTRIBUTES,
description="A Record Path value, pointing to a field of type ARRAY containing RECORD objects")
@WritesAttribute(attribute="record.count",description="The generated FlowFile will have a \'record.count\' attribute indicating the number of records that were written to the FlowFile.") @WritesAttribute(attribute="mime.type",description="The MIME Type indicated by the Record Writer") @WritesAttribute(attribute="<Attributes from Record Writer>",description="Any Attribute that the configured Record Writer returns will be added to the FlowFile.")
public class ForkRecord
extends org.apache.nifi.processor.AbstractProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptor(package private) static final org.apache.nifi.components.AllowableValue(package private) static final org.apache.nifi.components.AllowableValueprivate static final List<org.apache.nifi.components.PropertyDescriptor> static final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprivate RecordPathCachestatic 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> -
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 org.apache.nifi.components.PropertyDescriptorgetSupportedDynamicPropertyDescriptor(String propertyDescriptorName) 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, 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
-
recordPathCache
-
MODE_EXTRACT
static final org.apache.nifi.components.AllowableValue MODE_EXTRACT -
MODE_SPLIT
static final org.apache.nifi.components.AllowableValue MODE_SPLIT -
RECORD_READER
public static final org.apache.nifi.components.PropertyDescriptor RECORD_READER -
RECORD_WRITER
public static final org.apache.nifi.components.PropertyDescriptor RECORD_WRITER -
MODE
public static final org.apache.nifi.components.PropertyDescriptor MODE -
INCLUDE_PARENT_FIELDS
public static final org.apache.nifi.components.PropertyDescriptor INCLUDE_PARENT_FIELDS -
PROPERTY_DESCRIPTORS
-
REL_FORK
public static final org.apache.nifi.processor.Relationship REL_FORK -
REL_ORIGINAL
public static final org.apache.nifi.processor.Relationship REL_ORIGINAL -
REL_FAILURE
public static final org.apache.nifi.processor.Relationship REL_FAILURE -
RELATIONSHIPS
-
-
Constructor Details
-
ForkRecord
public ForkRecord()
-
-
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
-
getSupportedDynamicPropertyDescriptor
protected org.apache.nifi.components.PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName) - Overrides:
getSupportedDynamicPropertyDescriptorin classorg.apache.nifi.components.AbstractConfigurableComponent
-
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
-