Kafka S3 连接:基于挂钟的定时轮换似乎不写
Kafka S3 connect: timed rotation based on wall clock doesn't seem to write
我们使用的是 Confluent 的 Kafka S3 Connector,版本 5.2.1。 运行 分布式工作者设置中的一个节点。
根据 documentation 我们应该能够在大小和基于时间的间隔上将刷新设置为 S3。
我们正在使用以下刷新设置
{
"rotate.interval.ms": 300000, // 5 minutes
"flush.size": 1000,
"timestamp.extractor": "Wallclock" // default
... (other settings)
}
但我没有看到任何数据写入消息少于 1000 条但有可用数据的主题。
但是,当我将设置更改为较小的冲洗尺寸并删除旋转间隔时:
{
"flush.size": 5, // some small amount
"timestamp.extractor": "Wallclock", // default
... (other settings)
}
在所有其他设置相同的情况下,我可以立即看到 s3 存储桶中的数据。
我没有更改任何其他设置,因此我非常有信心可以连接到 s3,并且我看到正在部署任务工作人员。
我是不是漏掉了什么?
如果您想要每 5 分钟一次,您应该更喜欢 rotate.schedule.interval.ms
,这会强制 Connect 在此间隔内转储文件。
This configuration ensures that file commits are invoked every configured interval. ... The commit will be performed at the scheduled time, regardless of the previous commit time or number of messages
rotate.interval.ms
将根据批次中第一个使用的记录检查记录时间戳。
the time interval is determined by using a timestamp extractor
如果您的记录少于刷新大小,那么整个批次将在内存中等待,直到新记录进来时的时间戳差异大于第一个看到的记录。
flush.size
总是优先于所有其他时间设置,上次看源代码写文件的时候。
我们使用的是 Confluent 的 Kafka S3 Connector,版本 5.2.1。 运行 分布式工作者设置中的一个节点。
根据 documentation 我们应该能够在大小和基于时间的间隔上将刷新设置为 S3。
我们正在使用以下刷新设置
{
"rotate.interval.ms": 300000, // 5 minutes
"flush.size": 1000,
"timestamp.extractor": "Wallclock" // default
... (other settings)
}
但我没有看到任何数据写入消息少于 1000 条但有可用数据的主题。
但是,当我将设置更改为较小的冲洗尺寸并删除旋转间隔时:
{
"flush.size": 5, // some small amount
"timestamp.extractor": "Wallclock", // default
... (other settings)
}
在所有其他设置相同的情况下,我可以立即看到 s3 存储桶中的数据。
我没有更改任何其他设置,因此我非常有信心可以连接到 s3,并且我看到正在部署任务工作人员。
我是不是漏掉了什么?
如果您想要每 5 分钟一次,您应该更喜欢 rotate.schedule.interval.ms
,这会强制 Connect 在此间隔内转储文件。
This configuration ensures that file commits are invoked every configured interval. ... The commit will be performed at the scheduled time, regardless of the previous commit time or number of messages
rotate.interval.ms
将根据批次中第一个使用的记录检查记录时间戳。
the time interval is determined by using a timestamp extractor
如果您的记录少于刷新大小,那么整个批次将在内存中等待,直到新记录进来时的时间戳差异大于第一个看到的记录。
flush.size
总是优先于所有其他时间设置,上次看源代码写文件的时候。