@EventDriven @SupportsBatching(defaultDuration=TWENTY_FIVE_MILLIS) @Tags(value={"hash","dupe","duplicate","dedupe"}) @InputRequirement(value=INPUT_REQUIRED) @CapabilityDescription(value="Caches a value, computed from FlowFile attributes, for each incoming FlowFile and determines if the cached value has already been seen. If so, routes the FlowFile to \'duplicate\' with an attribute named \'original.identifier\' that specifies the original FlowFile\'s \"description\", which is specified in the <FlowFile Description> property. If the FlowFile is not determined to be a duplicate, the Processor routes the FlowFile to \'non-duplicate\'") @WritesAttribute(attribute="original.flowfile.description", description="All FlowFiles routed to the duplicate relationship will have an attribute added named original.flowfile.description. The value of this attribute is determined by the attributes of the original copy of the data and by the FlowFile Description property.") @SeeAlso(classNames={"org.apache.nifi.distributed.cache.client.DistributedMapCacheClientService","org.apache.nifi.distributed.cache.server.map.DistributedMapCacheServer"}) public class DetectDuplicate extends AbstractProcessor
Modifier and Type | Class and Description |
---|---|
private static class |
DetectDuplicate.CacheValue |
private static class |
DetectDuplicate.CacheValueDeserializer |
private static class |
DetectDuplicate.CacheValueSerializer |
private static class |
DetectDuplicate.StringSerializer |
Modifier and Type | Field and Description |
---|---|
static PropertyDescriptor |
AGE_OFF_DURATION |
static PropertyDescriptor |
CACHE_ENTRY_IDENTIFIER |
static PropertyDescriptor |
CACHE_IDENTIFIER |
static PropertyDescriptor |
DISTRIBUTED_CACHE_SERVICE |
static PropertyDescriptor |
FLOWFILE_DESCRIPTION |
private Serializer<String> |
keySerializer |
static String |
ORIGINAL_DESCRIPTION_ATTRIBUTE_NAME |
static Relationship |
REL_DUPLICATE |
static Relationship |
REL_FAILURE |
static Relationship |
REL_NON_DUPLICATE |
private Set<Relationship> |
relationships |
private Deserializer<DetectDuplicate.CacheValue> |
valueDeserializer |
private Serializer<DetectDuplicate.CacheValue> |
valueSerializer |
Constructor and Description |
---|
DetectDuplicate() |
Modifier and Type | Method and Description |
---|---|
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isStateful
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
public static final String ORIGINAL_DESCRIPTION_ATTRIBUTE_NAME
public static final PropertyDescriptor DISTRIBUTED_CACHE_SERVICE
public static final PropertyDescriptor CACHE_ENTRY_IDENTIFIER
public static final PropertyDescriptor FLOWFILE_DESCRIPTION
public static final PropertyDescriptor AGE_OFF_DURATION
public static final PropertyDescriptor CACHE_IDENTIFIER
public static final Relationship REL_DUPLICATE
public static final Relationship REL_NON_DUPLICATE
public static final Relationship REL_FAILURE
private final Set<Relationship> relationships
private final Serializer<String> keySerializer
private final Serializer<DetectDuplicate.CacheValue> valueSerializer
private final Deserializer<DetectDuplicate.CacheValue> valueDeserializer
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException
Copyright © 2024 Apache NiFi Project. All rights reserved.