Class DeduplicateRecord
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.DeduplicateRecord
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent,org.apache.nifi.processor.Processor
@SupportsBatching
@InputRequirement(INPUT_REQUIRED)
@SystemResourceConsideration(resource=MEMORY,description="The HashSet filter type will grow memory space proportionate to the number of unique records processed. The BloomFilter type will use constant memory regardless of the number of records processed.") @SystemResourceConsideration(resource=CPU,description="If a more advanced hash algorithm is chosen, the amount of time required to hash any particular record could increase substantially.")
@Tags({"text","record","update","change","replace","modify","distinct","unique","filter","hash","dupe","duplicate","dedupe"})
@CapabilityDescription("This processor de-duplicates individual records within a record set. It can operate on a per-file basis using an in-memory hashset or bloom filter. When configured with a distributed map cache, it de-duplicates records across multiple files.")
@WritesAttribute(attribute="record.count",
description="Number of records written to the destination FlowFile.")
@DynamicProperty(name="Name of the property.",
value="A valid RecordPath to the record field to be included in the cache key used for deduplication.",
description="A record\'s cache key is generated by combining the name of each dynamic property with its evaluated record value (as specified by the corresponding RecordPath).")
@SeeAlso(classNames={"org.apache.nifi.distributed.cache.client.DistributedMapCacheClientService","org.apache.nifi.distributed.cache.server.map.DistributedMapCacheServer","org.apache.nifi.processors.standard.DetectDuplicate"})
public class DeduplicateRecord
extends org.apache.nifi.processor.AbstractProcessor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescription(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(package private) static final org.apache.nifi.components.PropertyDescriptorprivate List<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 org.apache.nifi.components.AllowableValue(package private) static final org.apache.nifi.components.PropertyDescriptorstatic final charprivate DistributedMapCacheClient(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.AllowableValueprivate static final List<org.apache.nifi.components.PropertyDescriptor> (package private) static final org.apache.nifi.components.PropertyDescriptorprivate RecordReaderFactorystatic final Stringstatic final String(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.PropertyDescriptorprivate RecordPathCache(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.Relationshipprivate static final Set<org.apache.nifi.processor.Relationship> (package private) static final org.apache.nifi.components.AllowableValue(package private) static final org.apache.nifi.components.AllowableValueprivate static final Serializer<String> private booleanprivate RecordSetWriterFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext context) private StringevaluateKeyFromDynamicProperties(org.apache.nifi.processor.ProcessContext context, Record record, org.apache.nifi.flowfile.FlowFile flowFile) private DeduplicateRecord.FilterWrappergetFilter(org.apache.nifi.processor.ProcessContext context) Set<org.apache.nifi.processor.Relationship> protected org.apache.nifi.components.PropertyDescriptorgetSupportedDynamicPropertyDescriptor(String propertyDescriptorName) final List<org.apache.nifi.components.PropertyDescriptor> voidonScheduled(org.apache.nifi.processor.ProcessContext context) voidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) private voidsendOrRemove(org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile outputFlowFile, org.apache.nifi.processor.Relationship targetRelationship, String mimeType, boolean includeZeroRecordFlowFiles, WriteResult writeResult) Methods inherited from class org.apache.nifi.processor.AbstractProcessor
onTriggerMethods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, hashCode, onPropertyModified, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validateMethods inherited from interface org.apache.nifi.processor.Processor
isStateful, migrateProperties, migrateRelationships
-
Field Details
-
JOIN_CHAR
public static final char JOIN_CHAR- See Also:
-
RECORD_COUNT_ATTRIBUTE
- See Also:
-
RECORD_HASH_VALUE_ATTRIBUTE
- See Also:
-
recordPathCache
-
dynamicProperties
-
NONE_ALGORITHM_VALUE
static final org.apache.nifi.components.AllowableValue NONE_ALGORITHM_VALUE -
SHA256_ALGORITHM_VALUE
static final org.apache.nifi.components.AllowableValue SHA256_ALGORITHM_VALUE -
SHA512_ALGORITHM_VALUE
static final org.apache.nifi.components.AllowableValue SHA512_ALGORITHM_VALUE -
HASH_SET_VALUE
static final org.apache.nifi.components.AllowableValue HASH_SET_VALUE -
BLOOM_FILTER_VALUE
static final org.apache.nifi.components.AllowableValue BLOOM_FILTER_VALUE -
RECORD_READER
static final org.apache.nifi.components.PropertyDescriptor RECORD_READER -
RECORD_WRITER
static final org.apache.nifi.components.PropertyDescriptor RECORD_WRITER -
OPTION_SINGLE_FILE
static final org.apache.nifi.components.AllowableValue OPTION_SINGLE_FILE -
OPTION_MULTIPLE_FILES
static final org.apache.nifi.components.AllowableValue OPTION_MULTIPLE_FILES -
DEDUPLICATION_STRATEGY
static final org.apache.nifi.components.PropertyDescriptor DEDUPLICATION_STRATEGY -
DISTRIBUTED_MAP_CACHE
static final org.apache.nifi.components.PropertyDescriptor DISTRIBUTED_MAP_CACHE -
CACHE_IDENTIFIER
static final org.apache.nifi.components.PropertyDescriptor CACHE_IDENTIFIER -
PUT_CACHE_IDENTIFIER
static final org.apache.nifi.components.PropertyDescriptor PUT_CACHE_IDENTIFIER -
INCLUDE_ZERO_RECORD_FLOWFILES
static final org.apache.nifi.components.PropertyDescriptor INCLUDE_ZERO_RECORD_FLOWFILES -
RECORD_HASHING_ALGORITHM
static final org.apache.nifi.components.PropertyDescriptor RECORD_HASHING_ALGORITHM -
FILTER_TYPE
static final org.apache.nifi.components.PropertyDescriptor FILTER_TYPE -
FILTER_CAPACITY_HINT
static final org.apache.nifi.components.PropertyDescriptor FILTER_CAPACITY_HINT -
BLOOM_FILTER_FPP
static final org.apache.nifi.components.PropertyDescriptor BLOOM_FILTER_FPP -
PROPERTY_DESCRIPTORS
-
REL_DUPLICATE
static final org.apache.nifi.processor.Relationship REL_DUPLICATE -
REL_NON_DUPLICATE
static final org.apache.nifi.processor.Relationship REL_NON_DUPLICATE -
REL_ORIGINAL
static final org.apache.nifi.processor.Relationship REL_ORIGINAL -
REL_FAILURE
static final org.apache.nifi.processor.Relationship REL_FAILURE -
RELATIONSHIPS
-
mapCacheClient
-
readerFactory
-
writerFactory
-
useInMemoryStrategy
private boolean useInMemoryStrategy -
STRING_SERIALIZER
-
-
Constructor Details
-
DeduplicateRecord
public DeduplicateRecord()
-
-
Method Details
-
getRelationships
- Specified by:
getRelationshipsin interfaceorg.apache.nifi.processor.Processor- Overrides:
getRelationshipsin classorg.apache.nifi.processor.AbstractSessionFactoryProcessor
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptorsin classorg.apache.nifi.components.AbstractConfigurableComponent
-
getSupportedDynamicPropertyDescriptor
protected org.apache.nifi.components.PropertyDescriptor getSupportedDynamicPropertyDescriptor(String propertyDescriptorName) - Overrides:
getSupportedDynamicPropertyDescriptorin classorg.apache.nifi.components.AbstractConfigurableComponent
-
customValidate
protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext context) - Overrides:
customValidatein classorg.apache.nifi.components.AbstractConfigurableComponent
-
onScheduled
@OnScheduled public void onScheduled(org.apache.nifi.processor.ProcessContext context) -
getFilter
-
onTrigger
public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException - Specified by:
onTriggerin classorg.apache.nifi.processor.AbstractProcessor- Throws:
org.apache.nifi.processor.exception.ProcessException
-
sendOrRemove
private void sendOrRemove(org.apache.nifi.processor.ProcessSession session, org.apache.nifi.flowfile.FlowFile outputFlowFile, org.apache.nifi.processor.Relationship targetRelationship, String mimeType, boolean includeZeroRecordFlowFiles, WriteResult writeResult) -
evaluateKeyFromDynamicProperties
-