@EventDriven @SupportsBatching @Tags(value={"map","cache","fetch","distributed"}) @InputRequirement(value=INPUT_REQUIRED) @CapabilityDescription(value="Computes cache key(s) from FlowFile attributes, for each incoming FlowFile, and fetches the value(s) from the Distributed Map Cache associated with each key. If configured without a destination attribute, the incoming FlowFile\'s content is replaced with the binary data received by the Distributed Map Cache. If there is no value stored under that key then the flow file will be routed to \'not-found\'. Note that the processor will always attempt to read the entire cached value into memory before placing it in it\'s destination. This could be potentially problematic if the cached value is very large.") @WritesAttribute(attribute="user-defined", description="If the \'Put Cache Value In Attribute\' property is set then whatever it is set to will become the attribute key and the value would be whatever the response was from the Distributed Map Cache. If multiple cache entry identifiers are selected, multiple attributes will be written, using the evaluated value of this property, appended by a period (.) and the name of the cache entry identifier. For example, if the Cache Entry Identifier property is set to \'id,name\', and the user-defined property is named \'fetched\', then two attributes will be written, fetched.id and fetched.name, containing their respective values.") @SeeAlso(classNames={"org.apache.nifi.distributed.cache.client.DistributedMapCacheClientService","org.apache.nifi.distributed.cache.server.map.DistributedMapCacheServer","org.apache.nifi.processors.standard.PutDistributedMapCache"}) public class FetchDistributedMapCache extends AbstractProcessor
Modifier and Type | Class and Description |
---|---|
static class |
FetchDistributedMapCache.CacheValueDeserializer |
static class |
FetchDistributedMapCache.StringSerializer |
Modifier and Type | Field and Description |
---|---|
private Serializer<String> |
keySerializer |
static PropertyDescriptor |
PROP_CACHE_ENTRY_IDENTIFIER |
static PropertyDescriptor |
PROP_CHARACTER_SET |
static PropertyDescriptor |
PROP_DISTRIBUTED_CACHE_SERVICE |
static PropertyDescriptor |
PROP_PUT_ATTRIBUTE_MAX_LENGTH |
static PropertyDescriptor |
PROP_PUT_CACHE_VALUE_IN_ATTRIBUTE |
static Relationship |
REL_FAILURE |
static Relationship |
REL_NOT_FOUND |
static Relationship |
REL_SUCCESS |
private Set<Relationship> |
relationships |
private Deserializer<byte[]> |
valueDeserializer |
Constructor and Description |
---|
FetchDistributedMapCache() |
Modifier and Type | Method and Description |
---|---|
protected Collection<ValidationResult> |
customValidate(ValidationContext validationContext) |
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
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
public static final PropertyDescriptor PROP_DISTRIBUTED_CACHE_SERVICE
public static final PropertyDescriptor PROP_CACHE_ENTRY_IDENTIFIER
public static final PropertyDescriptor PROP_PUT_CACHE_VALUE_IN_ATTRIBUTE
public static final PropertyDescriptor PROP_PUT_ATTRIBUTE_MAX_LENGTH
public static final PropertyDescriptor PROP_CHARACTER_SET
public static final Relationship REL_SUCCESS
public static final Relationship REL_NOT_FOUND
public static final Relationship REL_FAILURE
private final Set<Relationship> relationships
private final Serializer<String> keySerializer
private final Deserializer<byte[]> valueDeserializer
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
protected Collection<ValidationResult> customValidate(ValidationContext validationContext)
customValidate
in class AbstractConfigurableComponent
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException
Copyright © 2021 Apache NiFi Project. All rights reserved.