ListGoogleDrive 2025.10.2.19

捆绑包

org.apache.nifi | nifi-gcp-nar

描述

列出 Google 云端硬盘文件夹中的具体文件(忽略快捷方式)。如果设置了“记录写入器”属性,则会创建单个输出 FlowFile,并且列表中的每个文件将作为单个记录写入输出文件。否则,将为列表中的每个文件创建单独的 FlowFile,将元数据写入为 FlowFile 属性。该处理器仅在集群中的主节点上运行。如果主节点发生变化,新的主节点将从前一个节点中断的地方继续,而不是复制所有数据。要设置对 Google 云端硬盘的访问权限,请参阅“其他详细信息”。

标签

drive、google、storage

输入要求

FORBIDDEN

支持敏感的动态属性

false

属性

属性

描述

connect-timeout

连接到 Google 云端硬盘服务的最长等待时间。

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.

folder-id

要从中提取文件列表的文件夹的 ID。要设置对 Google 云端硬盘的访问权限并获取文件夹 ID,请参阅“其他详细信息”。WARNING:未经授权访问该文件夹将被视为该文件夹为空的情况处理。这会导致处理器无法创建输出 FlowFiles。未提供其他错误消息。

gcp-credentials-provider-service

用于获取 Google Cloud Platform 凭据的控制器服务。

listing-strategy

指定如何确定新的/更新的实体。有关详细信息,请参阅每种策略的描述。

min-age

文件必须达到最短存在时间才纳入考虑;将会忽略小于该存在时间的所有文件。

proxy-configuration-service

指定代理配置控制器服务来代理网络请求。

read-timeout

Google 云端硬盘服务响应的最长等待时间。

record-writer

指定用于创建列表的记录写入器。如果未指定,则将为列出的每个实体创建一个 FlowFile。如果指定了记录写入器,则所有实体都将写入单个 FlowFile,而不是向单个 FlowFiles 添加属性。

recursive-search

为“true”时,将包括来自具体子文件夹的文件列表(忽略快捷方式)。否则,仅返回直接以定义的“文件夹 ID”作为其父级的文件。WARNING:如果子文件夹太多(500 个以上),则列表可能会失败。

状态管理

范围

描述

CLUSTER

处理器存储必要的数据,以便能够跟踪已经列出的文件。具体需要存储哪些数据取决于“列表策略”。状态存储在整个集群中,因此该处理器只能在主节点上运行,如果选择了新的主节点,则新节点可以从前一个节点中断的地方继续,而无需复制数据。

关系

名称

描述

success

所有收到的 FlowFiles 都将路由至“success”

写入属性

名称

描述

drive.id

文件的 ID

filename

文件的名称

mime.type

文件的 MIME 类型

drive.size

文件的大小。未提供文件大小时(例如外部存储的文件),设置为 0。

drive.size.available

表示文件大小是否已知/提供

drive.timestamp

文件的上次修改时间或创建时间(以较长者为准)。原因是文件在上传到 Google 云端硬盘时,会保留文件的原始修改日期。“创建时间”是指上传发生的时间。但是,上传的文件以后仍然可以修改。

drive.created.time

文件的创建时间

drive.modified.time

文件的上次修改时间

drive.path

从基目录到该文件所在目录的路径。该路径包含 URL 编码形式的文件夹名称,因为 Google 云端硬盘允许在文件名中使用特殊字符,包括“/”(斜杠)和“”(反斜杠)。URL 编码后的文件夹名称在路径中以“/”分隔。

drive.owner

文件的所有者

drive.last.modifying.user

上次修改文件的用户

drive.web.view.link

指向文件的 Web 视图链接

drive.web.content.link

指向文件的 Web 内容链接

drive.parent.folder.id

文件父文件夹的 ID

drive.parent.folder.name

文件父文件夹的名称

drive.listed.folder.id

列出的基本文件夹的 ID

drive.listed.folder.name

列出的基本文件夹的名称

drive.shared.drive.id

共享硬盘的 ID(如果文件位于共享硬盘上)

drive.shared.drive.name

共享硬盘的名称(如果文件位于共享硬盘上)

另请参阅

语言: 中文