ListSmb 2025.10.2.19¶
捆绑包¶
org.apache.nifi | nifi-smb-nar
描述¶
列出通过 SMB 协议共享的具体文件。列出的每个文件都有可能生成一个 FlowFile,元数据作为 FlowFile 属性写入。或者,如果设置了“记录写入器”属性,则整个结果将作为记录写入到单个 FlowFile 中。该处理器仅在集群中的主节点上运行。如果主节点发生变化,新的主节点将从前一个节点中断的地方继续,而不是复制所有数据。
输入要求¶
FORBIDDEN
支持敏感的动态属性¶
false
属性¶
属性 |
描述 |
|---|---|
目录 |
列出文件所对应的网络文件夹。这是位于共享之后的那部分相对路径:smb://HOSTNAME:PORT/SHARE/[DIRECTORY]/sub/directories。也可以添加子目录。远程文件共享上的给定路径必须存在。这可以通过验证来进行检查。您可以混合使用 Windows 和 Linux 样式的目录分隔符。 |
et-initial-listing-target |
Specify how initial listing should be handled. Used by 'Tracking Entities'strategy. |
et-state-cache |
Listed entities are stored in the specified cache storage so that this processor can resume listing across NiFi restart or in case of primary node change. 'Tracking Entities'strategy require tracking information of all listed entities within the last 'Tracking Time Window'. To support large number of entities, the strategy uses DistributedMapCache instead of managed state. Cache key format is 'ListedEntities::{processorId}(::{nodeId})'. If it tracks per node listed entities, then the optional '::{nodeId}' part is added to manage state separately. E.g. cluster wide cache key ='ListedEntities::8dda2321-0164-1000-50fa-3042fe7d6a7b', per node cache key ='ListedEntities::8dda2321-0164-1000-50fa-3042fe7d6a7b::nifi-node3' The stored cache content is Gzipped JSON string. The cache key will be deleted when target listing configuration is changed. Used by 'Tracking Entities'strategy. |
et-time-window |
Specify how long this processor should track already-listed entities. 'Tracking Entities'strategy can pick any entity whose timestamp is inside the specified time window. For example, if set to '30 minutes', any entity having timestamp in recent 30 minutes will be the listing target when this processor runs. A listed entity is considered 'new/updated' and a FlowFile is emitted if one of following condition meets: 1. does not exist in the already-listed entities, 2. has newer timestamp than the cached entity, 3. has different size than the cached entity. If a cached entity 's timestamp becomes older than specified time window, that entity will be removed from the cached already-listed entities. Used by'Tracking Entities'strategy. |
file-filter |
只有名称与给定正则表达式匹配的文件才会被列出。 |
file-name-suffix-filter |
使用给定后缀结尾的文件将被忽略。可为这些文件添加后缀并在上传完成后移除后缀,从而确保不多次列出仍在上传的文件。强烈建议在使用“跟踪实体”或“跟踪时间戳”列表策略时使用此方法。 |
initial-listing-strategy |
指定处理器首次启动(或其状态已清除)时,如何处理 SMB 共享中的现有文件。 |
initial-listing-timestamp |
当处理器首次启动(或其状态已清除)时,要列出的文件对应的时间戳。该值可以指定为以毫秒为单位的纪元时间戳,也可指定为 2025-02-01T00:00:00Z 等格式的 UTC 日期时间 |
listing-strategy |
指定如何确定新的/更新的实体。有关详细信息,请参阅每种策略的描述。 |
max-file-age |
任何早于给定值的文件都将被忽略。 |
max-file-size |
任何大于给定值的文件都将被忽略。 |
min-file-age |
文件列出的最短存在时间;任何未达到此存在时间的文件都将被忽略。 |
min-file-size |
任何小于给定值的文件都将被忽略。 |
path-filter |
仅列出路径(直至文件父目录)与给定正则表达式匹配的文件。 |
record-writer |
指定用于创建列表的记录写入器。如果未指定,则将为列出的每个实体创建一个 FlowFile。如果指定了记录写入器,则所有实体都将写入单个 FlowFile,而不是向单个 FlowFiles 添加属性。 |
smb-client-provider-service |
指定用于创建 SMB 连接的 SMB 客户端提供商。 |
target-system-timestamp-precision |
指定目标系统的时间戳精度。由于该处理器使用实体的时间戳来决定应列出哪些实体,因此使用正确的时间戳精度至关重要。 |
状态管理¶
范围 |
描述 |
|---|---|
CLUSTER |
执行文件列表后,可以存储先前列表的状态,以便连续列出文件,避免重复。 |
关系¶
名称 |
描述 |
|---|---|
success |
所有收到的 FlowFiles 都将路由至“success” |
写入属性¶
名称 |
描述 |
|---|---|
filename |
从文件系统读取的文件的名称。 |
shortName |
从文件系统中读取的文件的短名称。 |
path |
相比于共享根目录,该路径设置为远程文件系统中文件目录的相对路径。例如,对于给定远程位置 smb://HOSTNAME:PORT/SHARE/DIRECTORY,如果列出了 smb://HOSTNAME:PORT/SHARE/DIRECTORY/sub/folder/file 中的一个文件,则路径属性会设置为“DIRECTORY/sub/folder”。 |
serviceLocation |
共享的 SMB URL。 |
lastModifiedTime |
文件系统中更改文件内容的时间戳,格式为“yyyy-MM-dd'T'HH:mm:ss”。 |
creationTime |
文件系统中创建文件的时间戳,格式为“yyyy-MM-dd'T'HH:mm:ss”。 |
lastAccessTime |
文件系统中访问文件的时间戳,格式为“yyyy-MM-dd'T'HH:mm:ss”。 |
changeTime |
文件系统中更改文件属性的时间戳,格式为“yyyy-MM-dd'T'HH:mm:ss”。 |
大小 |
文件大小(以字节为单位)。 |
allocationSize |
服务器上为文件分配的字节数。 |