@EventDriven @SideEffectFree @SupportsBatching @Tags(value={"xml","split"}) @InputRequirement(value=INPUT_REQUIRED) @CapabilityDescription(value="Splits an XML File into multiple separate FlowFiles, each comprising a child or descendant of the original root element") @WritesAttribute(attribute="fragment.identifier",description="All split FlowFiles produced from the same parent FlowFile will have the same randomly generated UUID added for this attribute") @WritesAttribute(attribute="fragment.index",description="A one-up number that indicates the ordering of the split FlowFiles that were created from a single parent FlowFile") @WritesAttribute(attribute="fragment.count",description="The number of split FlowFiles generated from the parent FlowFile") @WritesAttribute(attribute="segment.original.filename ",description="The filename of the parent FlowFile") @SystemResourceConsideration(resource=MEMORY, description="The entirety of the FlowFile\'s content (as a Document object) is read into memory, in addition to all of the generated FlowFiles representing the split XML. A Document object can take approximately 10 times as much memory as the size of the XML. For example, a 1 MB XML document may use 10 MB of memory. If many splits are generated due to the size of the XML, a two-phase approach may be necessary to avoid excessive use of memory.") public class SplitXml extends AbstractProcessor
| Modifier and Type | Class and Description |
|---|---|
private static class |
SplitXml.XmlSplitterSaxParser |
| Modifier and Type | Field and Description |
|---|---|
private List<PropertyDescriptor> |
properties |
static Relationship |
REL_FAILURE |
static Relationship |
REL_ORIGINAL |
static Relationship |
REL_SPLIT |
private Set<Relationship> |
relationships |
static PropertyDescriptor |
SPLIT_DEPTH |
| Constructor and Description |
|---|
SplitXml() |
| Modifier and Type | Method and Description |
|---|---|
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
protected void |
init(ProcessorInitializationContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTruecustomValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatepublic static final PropertyDescriptor SPLIT_DEPTH
public static final Relationship REL_ORIGINAL
public static final Relationship REL_SPLIT
public static final Relationship REL_FAILURE
private List<PropertyDescriptor> properties
private Set<Relationship> relationships
protected void init(ProcessorInitializationContext context)
init in class AbstractSessionFactoryProcessorpublic Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorprotected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentpublic void onTrigger(ProcessContext context, ProcessSession session)
onTrigger in class AbstractProcessorCopyright © 2023 Apache NiFi Project. All rights reserved.