FetchDistributedMapCache 2025.10.2.19

捆绑包

org.apache.nifi | nifi-standard-nar

描述

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.

标签

cache、distributed、fetch、map

输入要求

REQUIRED

支持敏感的动态属性

false

属性

属性

描述

缓存条目标识符

以逗号分隔的 FlowFile 属性列表或属性表达式语言语句的结果,将根据 FlowFile 进行评估,以确定用于识别重复项的值;缓存的正是这些值。NOTE:除非指定“将缓存值写入属性”,否则只允许使用单个“缓存条目标识符”。仅当目标是一组属性时,才支持多次缓存查找(有关包括命名约定在内的更多详细信息,请参阅“将缓存值写入属性”文档)。

字符集

对缓存值进行编码的字符集。这仅在路由到属性时使用。

分布式缓存服务

用于获取缓存值的控制器服务。

写入属性的最大长度

如果将缓存值路由到 FlowFile 的某个属性(通过设置“将缓存值写入属性”属性),则属性值的字符数最多为这个数量。这很重要,因为属性保存在内存中,大型属性会很快导致内存不足问题。如果输出长于该值,则会将其截断以适配。如果可以的话,建议酌情缩小此值。

将缓存值写入属性

如有设置,则接收到的缓存值将放入 FlowFile 的属性中,而非 theFlowFile 的内容中。放入的属性键是通过评估该属性的值来确定的。如果选择了多个“缓存条目标识符”,则将使用该属性的评估值写入多个属性,并追加句点 (.) 和缓存条目标识符的名称。

关系

名称

描述

failure

如果无法与缓存通信,或缓存条目被评估为空白,则 FlowFile 会受到惩罚并路由到此关系

not-found

如果在缓存中找不到 FlowFile 的缓存条目标识符,则会将其路由到此关系

success

如果成功与缓存通信,它将路由到此关系

写入属性

名称

描述

user-defined

如果设置了“将缓存值写入属性”属性,那么无论将它设置为什么,它都会成为属性键,而值则是“Distributed Map Cache”的响应值。如果选择了多个“缓存条目标识符”,则将使用该属性的评估值写入多个属性,并追加句点 (.) 和缓存条目标识符的名称。例如,如果将“缓存条目标识符”属性设置为“id,name”,并将用户定义的属性命名为“fetched”,则将写入两个属性 fetched.id 和 fetched.name,其中包含它们各自的值。

另请参阅

语言: 中文