@SideEffectFree @SupportsBatching @InputRequirement(value=INPUT_REQUIRED) @Tags(value={"fork","record","content","array","stream","event"}) @CapabilityDescription(value="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.") @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 AbstractProcessor
Modifier and Type | Field and Description |
---|---|
static PropertyDescriptor |
INCLUDE_PARENT_FIELDS |
static PropertyDescriptor |
MODE |
(package private) static AllowableValue |
MODE_EXTRACT |
(package private) static AllowableValue |
MODE_SPLIT |
static PropertyDescriptor |
RECORD_READER |
static PropertyDescriptor |
RECORD_WRITER |
private RecordPathCache |
recordPathCache |
static Relationship |
REL_FAILURE |
static Relationship |
REL_FORK |
static Relationship |
REL_ORIGINAL |
Constructor and Description |
---|
ForkRecord() |
Modifier and Type | Method and Description |
---|---|
protected Collection<ValidationResult> |
customValidate(ValidationContext validationContext) |
Set<Relationship> |
getRelationships() |
protected PropertyDescriptor |
getSupportedDynamicPropertyDescriptor(String propertyDescriptorName) |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
private volatile RecordPathCache recordPathCache
static final AllowableValue MODE_EXTRACT
static final AllowableValue MODE_SPLIT
public static final PropertyDescriptor RECORD_READER
public static final PropertyDescriptor RECORD_WRITER
public static final PropertyDescriptor MODE
public static final PropertyDescriptor INCLUDE_PARENT_FIELDS
public static final Relationship REL_FORK
public static final Relationship REL_ORIGINAL
public static final Relationship REL_FAILURE
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName)
getSupportedDynamicPropertyDescriptor
in class AbstractConfigurableComponent
protected Collection<ValidationResult> customValidate(ValidationContext validationContext)
customValidate
in class AbstractConfigurableComponent
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException
Copyright © 2020 Apache NiFi Project. All rights reserved.