Kafka Source Connector max.tasks 的理想配置设置

Ideal configuration setting for max.tasks for Kafka Source Connector

我正在尝试 运行 HDFS 源连接器和 FileStream 源连接器。我想知道如果我们设置 tasks.max > 1 它将如何工作。连接器的工作不是确保正确处理并行性吗?

例如,如果有超过 1 个任务访问文件,FileStream Source Connector 不会有问题吗?连接器如何知道哪个任务正在读取哪一行以及如何确保任务之间没有冲突?

对于可能出现此类问题的连接器,是否应该设置为tasks.max=1

不存在这样的问题,因为根据 docs:

tasks.max - The maximum number of tasks that should be created for this connector. The connector may create fewer tasks if it cannot achieve this level of parallelism.

例如,对于 File Stream Source Connector max.tasks 是简单的 ignored, while for JDBC Source Connector the real number of tasks is defined as minimum of tasks.max 并且表格计数。