@TriggerWhenEmpty @SideEffectFree @Tags(value={"fork","join","enrichment","record","sql","wrap","recordpath","merge","combine","streams"}) @CapabilityDescription(value="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(value=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(value=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
MAX_BIN_AGE, MAX_ENTRIES, MAX_SIZE, MIN_ENTRIES, MIN_SIZE
Constructor and Description |
---|
JoinEnrichment() |
additionalCustomValidation, customValidate, getReadyBins, onScheduled, onTrigger, resetState
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isStateful
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
static final String GROUP_ID_ATTRIBUTE
static final String ENRICHMENT_ROLE_ATTRIBUTE
static final String RECORD_COUNT_ATTRIBUTE
static final AllowableValue JOIN_WRAPPER
static final AllowableValue JOIN_SQL
static final AllowableValue JOIN_INSERT_ENRICHMENT_FIELDS
static final PropertyDescriptor ORIGINAL_RECORD_READER
static final PropertyDescriptor ENRICHMENT_RECORD_READER
static final PropertyDescriptor RECORD_WRITER
static final PropertyDescriptor JOIN_STRATEGY
static final PropertyDescriptor SQL
static final PropertyDescriptor DEFAULT_PRECISION
static final PropertyDescriptor DEFAULT_SCALE
static final PropertyDescriptor INSERTION_RECORD_PATH
static final PropertyDescriptor TIMEOUT
static final PropertyDescriptor MAX_BIN_COUNT
private static final List<PropertyDescriptor> properties
static final Relationship REL_JOINED
static final Relationship REL_ORIGINAL
static final Relationship REL_TIMEOUT
static final Relationship REL_FAILURE
private static final Set<Relationship> relationships
private final SqlJoinCache sqlJoinCache
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
@OnScheduled public void registerCalciteDriver()
@OnStopped public void cleanup() throws Exception
Exception
protected FlowFile preprocessFlowFile(ProcessContext context, ProcessSession session, FlowFile flowFile)
preprocessFlowFile
in class BinFiles
protected String getGroupId(ProcessContext context, FlowFile flowFile, ProcessSession session)
getGroupId
in class BinFiles
protected void setUpBinManager(BinManager binManager, ProcessContext context)
setUpBinManager
in class BinFiles
protected int getMinEntries(PropertyContext context)
getMinEntries
in class BinFiles
protected int getMaxEntries(PropertyContext context)
getMaxEntries
in class BinFiles
protected long getMinBytes(PropertyContext context)
getMinBytes
in class BinFiles
protected long getMaxBytes(PropertyContext context)
getMaxBytes
in class BinFiles
protected int getMaxBinAgeSeconds(PropertyContext context)
getMaxBinAgeSeconds
in class BinFiles
protected BinProcessingResult processBin(Bin unmodifiableBin, ProcessContext context) throws ProcessException
processBin
in class BinFiles
ProcessException
private RecordSchema getReaderSchema(RecordReaderFactory recordReaderFactory, FlowFile flowFile, ProcessSession session) throws IOException, MalformedRecordException, SchemaNotFoundException
private BinProcessingResult transferFailure(List<FlowFile> flowFiles, ProcessSession session)
private RecordJoinStrategy getJoinStrategy(ProcessContext context, Map<String,String> attributes)
private FlowFile getFlowFileWithRole(Collection<FlowFile> flowFiles, EnrichmentRole desiredRole)
private EnrichmentRole getEnrichmentRole(FlowFile flowFile)
private EnrichmentRole getOtherEnrichmentRole(EnrichmentRole role)
protected int processBins(ProcessContext context, ProcessSessionFactory sessionFactory)
processBins
in class BinFiles
Copyright © 2023 Apache NiFi Project. All rights reserved.