Class JoinEnrichment

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.util.bin.BinFiles
org.apache.nifi.processors.standard.JoinEnrichment
All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.processor.Processor

@TriggerWhenEmpty @SideEffectFree @Tags({"fork","join","enrichment","record","sql","wrap","recordpath","merge","combine","streams"}) @CapabilityDescription("Joins together Records from two different FlowFiles where one FlowFile, the \'original\' contains arbitrary records and the second FlowFile, the \'enrichment\' contains additional data that should be used to enrich the first. See Additional Details for more information on how to configure this processor and the different use cases that it aims to accomplish.") @SeeAlso(ForkEnrichment.class) @WritesAttribute(attribute="mime.type",description="Sets the mime.type attribute to the MIME Type specified by the Record Writer") @WritesAttribute(attribute="record.count",description="The number of records in the FlowFile") @InputRequirement(INPUT_REQUIRED) @SystemResourceConsideration(resource=MEMORY, description="This Processor will load into heap all FlowFiles that are on its incoming queues. While it loads the FlowFiles themselves, and not their content, the FlowFile attributes can be very memory intensive. Additionally, if the Join Strategy is set to SQL, the SQL engine may require buffering the entire contents of the enrichment FlowFile for each concurrent task. See Processor\'s Additional Details for more details and for steps on how to mitigate these concerns.") public class JoinEnrichment extends BinFiles
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final String
     
    (package private) static final String
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.AllowableValue
     
    (package private) static final org.apache.nifi.components.AllowableValue
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.AllowableValue
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    private static final List<org.apache.nifi.components.PropertyDescriptor>
     
    (package private) static final String
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    (package private) static final org.apache.nifi.processor.Relationship
     
    (package private) static final org.apache.nifi.processor.Relationship
     
    (package private) static final org.apache.nifi.processor.Relationship
     
    (package private) static final org.apache.nifi.processor.Relationship
     
    private static final Set<org.apache.nifi.processor.Relationship>
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     
    private final SqlJoinCache
     
    (package private) static final org.apache.nifi.components.PropertyDescriptor
     

    Fields inherited from class org.apache.nifi.processor.util.bin.BinFiles

    MAX_BIN_AGE, MAX_ENTRIES, MAX_SIZE, MIN_ENTRIES, MIN_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    getEnrichmentRole(org.apache.nifi.flowfile.FlowFile flowFile)
     
    private org.apache.nifi.flowfile.FlowFile
    getFlowFileWithRole(Collection<org.apache.nifi.flowfile.FlowFile> flowFiles, EnrichmentRole desiredRole)
     
    protected String
    getGroupId(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile, org.apache.nifi.processor.ProcessSession session)
     
    getJoinStrategy(org.apache.nifi.processor.ProcessContext context, Map<String,String> attributes)
     
    protected int
    getMaxBinAgeSeconds(org.apache.nifi.context.PropertyContext context)
     
    protected long
    getMaxBytes(org.apache.nifi.context.PropertyContext context)
     
    protected int
    getMaxEntries(org.apache.nifi.context.PropertyContext context)
     
    protected long
    getMinBytes(org.apache.nifi.context.PropertyContext context)
     
    protected int
    getMinEntries(org.apache.nifi.context.PropertyContext context)
     
     
    private RecordSchema
    getReaderSchema(RecordReaderFactory recordReaderFactory, org.apache.nifi.flowfile.FlowFile flowFile, org.apache.nifi.processor.ProcessSession session)
     
    Set<org.apache.nifi.processor.Relationship>
     
    protected List<org.apache.nifi.components.PropertyDescriptor>
     
    protected org.apache.nifi.flowfile.FlowFile
    preprocessFlowFile(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile flowFile)
     
    processBin(Bin unmodifiableBin, org.apache.nifi.processor.ProcessContext context)
     
    protected int
    processBins(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSessionFactory sessionFactory)
     
    protected void
    setUpBinManager(BinManager binManager, org.apache.nifi.processor.ProcessContext context)
     
    transferFailure(List<org.apache.nifi.flowfile.FlowFile> flowFiles, org.apache.nifi.processor.ProcessSession session)
     

    Methods inherited from class org.apache.nifi.processor.util.bin.BinFiles

    additionalCustomValidation, customValidate, getReadyBins, onScheduled, onTrigger, resetState

    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

    • GROUP_ID_ATTRIBUTE

      static final String GROUP_ID_ATTRIBUTE
      See Also:
    • ENRICHMENT_ROLE_ATTRIBUTE

      static final String ENRICHMENT_ROLE_ATTRIBUTE
      See Also:
    • RECORD_COUNT_ATTRIBUTE

      static final String RECORD_COUNT_ATTRIBUTE
      See Also:
    • JOIN_WRAPPER

      static final org.apache.nifi.components.AllowableValue JOIN_WRAPPER
    • JOIN_SQL

      static final org.apache.nifi.components.AllowableValue JOIN_SQL
    • JOIN_INSERT_ENRICHMENT_FIELDS

      static final org.apache.nifi.components.AllowableValue JOIN_INSERT_ENRICHMENT_FIELDS
    • ORIGINAL_RECORD_READER

      static final org.apache.nifi.components.PropertyDescriptor ORIGINAL_RECORD_READER
    • ENRICHMENT_RECORD_READER

      static final org.apache.nifi.components.PropertyDescriptor ENRICHMENT_RECORD_READER
    • RECORD_WRITER

      static final org.apache.nifi.components.PropertyDescriptor RECORD_WRITER
    • JOIN_STRATEGY

      static final org.apache.nifi.components.PropertyDescriptor JOIN_STRATEGY
    • SQL

      static final org.apache.nifi.components.PropertyDescriptor SQL
    • DEFAULT_PRECISION

      static final org.apache.nifi.components.PropertyDescriptor DEFAULT_PRECISION
    • DEFAULT_SCALE

      static final org.apache.nifi.components.PropertyDescriptor DEFAULT_SCALE
    • INSERTION_RECORD_PATH

      static final org.apache.nifi.components.PropertyDescriptor INSERTION_RECORD_PATH
    • TIMEOUT

      static final org.apache.nifi.components.PropertyDescriptor TIMEOUT
    • MAX_BIN_COUNT

      static final org.apache.nifi.components.PropertyDescriptor MAX_BIN_COUNT
    • PROPERTY_DESCRIPTORS

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

      static final org.apache.nifi.processor.Relationship REL_JOINED
    • REL_ORIGINAL

      static final org.apache.nifi.processor.Relationship REL_ORIGINAL
    • REL_TIMEOUT

      static final org.apache.nifi.processor.Relationship REL_TIMEOUT
    • REL_FAILURE

      static final org.apache.nifi.processor.Relationship REL_FAILURE
    • RELATIONSHIPS

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

      private final SqlJoinCache sqlJoinCache
  • Constructor Details

    • JoinEnrichment

      public JoinEnrichment()
  • Method Details

    • getSupportedPropertyDescriptors

      protected List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent
    • 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
    • cleanup

      @OnStopped public void cleanup() throws Exception
      Throws:
      Exception
    • preprocessFlowFile

      protected org.apache.nifi.flowfile.FlowFile preprocessFlowFile(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile flowFile)
      Specified by:
      preprocessFlowFile in class BinFiles
    • getGroupId

      protected String getGroupId(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.flowfile.FlowFile flowFile, org.apache.nifi.processor.ProcessSession session)
      Specified by:
      getGroupId in class BinFiles
    • setUpBinManager

      protected void setUpBinManager(BinManager binManager, org.apache.nifi.processor.ProcessContext context)
      Specified by:
      setUpBinManager in class BinFiles
    • getMinEntries

      protected int getMinEntries(org.apache.nifi.context.PropertyContext context)
      Overrides:
      getMinEntries in class BinFiles
    • getMaxEntries

      protected int getMaxEntries(org.apache.nifi.context.PropertyContext context)
      Overrides:
      getMaxEntries in class BinFiles
    • getMinBytes

      protected long getMinBytes(org.apache.nifi.context.PropertyContext context)
      Overrides:
      getMinBytes in class BinFiles
    • getMaxBytes

      protected long getMaxBytes(org.apache.nifi.context.PropertyContext context)
      Overrides:
      getMaxBytes in class BinFiles
    • getMaxBinAgeSeconds

      protected int getMaxBinAgeSeconds(org.apache.nifi.context.PropertyContext context)
      Overrides:
      getMaxBinAgeSeconds in class BinFiles
    • processBin

      protected BinProcessingResult processBin(Bin unmodifiableBin, org.apache.nifi.processor.ProcessContext context) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      processBin in class BinFiles
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • getReaderSchema

      private RecordSchema getReaderSchema(RecordReaderFactory recordReaderFactory, org.apache.nifi.flowfile.FlowFile flowFile, org.apache.nifi.processor.ProcessSession session) throws IOException, MalformedRecordException, SchemaNotFoundException
      Throws:
      IOException
      MalformedRecordException
      SchemaNotFoundException
    • transferFailure

      private BinProcessingResult transferFailure(List<org.apache.nifi.flowfile.FlowFile> flowFiles, org.apache.nifi.processor.ProcessSession session)
    • getJoinStrategy

      private RecordJoinStrategy getJoinStrategy(org.apache.nifi.processor.ProcessContext context, Map<String,String> attributes)
    • getFlowFileWithRole

      private org.apache.nifi.flowfile.FlowFile getFlowFileWithRole(Collection<org.apache.nifi.flowfile.FlowFile> flowFiles, EnrichmentRole desiredRole)
    • getEnrichmentRole

      private EnrichmentRole getEnrichmentRole(org.apache.nifi.flowfile.FlowFile flowFile)
    • getOtherEnrichmentRole

      private EnrichmentRole getOtherEnrichmentRole(EnrichmentRole role)
    • processBins

      protected int processBins(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSessionFactory sessionFactory)
      Overrides:
      processBins in class BinFiles