Class SplitContent

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.SplitContent
All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.processor.Processor

@SideEffectFree @SupportsBatching @Tags({"content","split","binary"}) @InputRequirement(INPUT_REQUIRED) @CapabilityDescription("Splits incoming FlowFiles by a specified byte sequence") @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") @SeeAlso(MergeContent.class) @SystemResourceConsideration(resource=MEMORY, description="The FlowFile with its attributes is stored in memory, not the content of the FlowFile. If many splits are generated due to the size of the content, or how the content is configured to be split, a two-phase approach may be necessary to avoid excessive use of memory.") public class SplitContent extends org.apache.nifi.processor.AbstractProcessor
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    private final AtomicReference<byte[]>
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final String
     
    static final String
     
    static final String
     
    (package private) static final org.apache.nifi.components.AllowableValue
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.AllowableValue
     
    private static final List<org.apache.nifi.components.PropertyDescriptor>
     
    static final org.apache.nifi.processor.Relationship
     
    static final org.apache.nifi.processor.Relationship
     
    private static final Set<org.apache.nifi.processor.Relationship>
     
    static final String
     
    (package private) static final org.apache.nifi.components.AllowableValue
     
    (package private) static final org.apache.nifi.components.AllowableValue
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Collection<org.apache.nifi.components.ValidationResult>
    customValidate(org.apache.nifi.components.ValidationContext validationContext)
     
    private String
    finishFragmentAttributes(org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile source, List<org.apache.nifi.flowfile.FlowFile> splits)
    Apply split index, count and other attributes.
    Set<org.apache.nifi.processor.Relationship>
     
    protected List<org.apache.nifi.components.PropertyDescriptor>
     
    void
    initializeByteSequence(org.apache.nifi.processor.ProcessContext context)
     
    void
    onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session)
     

    Methods inherited from class org.apache.nifi.processor.AbstractProcessor

    onTrigger

    Methods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor

    getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue

    Methods inherited from class org.apache.nifi.components.AbstractConfigurableComponent

    equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.nifi.components.ConfigurableComponent

    getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate

    Methods inherited from interface org.apache.nifi.processor.Processor

    isStateful, migrateProperties, migrateRelationships
  • Field Details

    • FRAGMENT_ID

      public static final String FRAGMENT_ID
    • FRAGMENT_INDEX

      public static final String FRAGMENT_INDEX
    • FRAGMENT_COUNT

      public static final String FRAGMENT_COUNT
    • SEGMENT_ORIGINAL_FILENAME

      public static final String SEGMENT_ORIGINAL_FILENAME
    • HEX_FORMAT

      static final org.apache.nifi.components.AllowableValue HEX_FORMAT
    • UTF8_FORMAT

      static final org.apache.nifi.components.AllowableValue UTF8_FORMAT
    • TRAILING_POSITION

      static final org.apache.nifi.components.AllowableValue TRAILING_POSITION
    • LEADING_POSITION

      static final org.apache.nifi.components.AllowableValue LEADING_POSITION
    • FORMAT

      public static final org.apache.nifi.components.PropertyDescriptor FORMAT
    • BYTE_SEQUENCE

      public static final org.apache.nifi.components.PropertyDescriptor BYTE_SEQUENCE
    • KEEP_SEQUENCE

      public static final org.apache.nifi.components.PropertyDescriptor KEEP_SEQUENCE
    • BYTE_SEQUENCE_LOCATION

      public static final org.apache.nifi.components.PropertyDescriptor BYTE_SEQUENCE_LOCATION
    • PROPERTY_DESCRIPTORS

      private static final List<org.apache.nifi.components.PropertyDescriptor> PROPERTY_DESCRIPTORS
    • REL_SPLITS

      public static final org.apache.nifi.processor.Relationship REL_SPLITS
    • REL_ORIGINAL

      public static final org.apache.nifi.processor.Relationship REL_ORIGINAL
    • RELATIONSHIPS

      private static final Set<org.apache.nifi.processor.Relationship> RELATIONSHIPS
    • byteSequence

      private final AtomicReference<byte[]> byteSequence
  • Constructor Details

    • SplitContent

      public SplitContent()
  • Method Details

    • getRelationships

      public Set<org.apache.nifi.processor.Relationship> getRelationships()
      Specified by:
      getRelationships in interface org.apache.nifi.processor.Processor
      Overrides:
      getRelationships in class org.apache.nifi.processor.AbstractSessionFactoryProcessor
    • getSupportedPropertyDescriptors

      protected List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent
    • customValidate

      protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext)
      Overrides:
      customValidate in class org.apache.nifi.components.AbstractConfigurableComponent
    • initializeByteSequence

      @OnScheduled public void initializeByteSequence(org.apache.nifi.processor.ProcessContext context) throws org.apache.commons.codec.DecoderException
      Throws:
      org.apache.commons.codec.DecoderException
    • onTrigger

      public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session)
      Specified by:
      onTrigger in class org.apache.nifi.processor.AbstractProcessor
    • finishFragmentAttributes

      private String finishFragmentAttributes(org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile source, List<org.apache.nifi.flowfile.FlowFile> splits)
      Apply split index, count and other attributes.
      Parameters:
      session - session
      source - source
      splits - splits
      Returns:
      generated fragment identifier for the splits