【发布时间】:2018-06-16 03:39:30
【问题描述】:
我正在尝试使用 Confluent S3 接收器的 TimeBasedPartitioner。这是我的配置:
{
"name":"s3-sink",
"config":{
"connector.class":"io.confluent.connect.s3.S3SinkConnector",
"tasks.max":"1",
"file":"test.sink.txt",
"topics":"xxxxx",
"s3.region":"yyyyyy",
"s3.bucket.name":"zzzzzzz",
"s3.part.size":"5242880",
"flush.size":"1000",
"storage.class":"io.confluent.connect.s3.storage.S3Storage",
"format.class":"io.confluent.connect.s3.format.avro.AvroFormat",
"schema.generator.class":"io.confluent.connect.storage.hive.schema.DefaultSchemaGenerator",
"partitioner.class":"io.confluent.connect.storage.partitioner.TimeBasedPartitioner",
"timestamp.extractor":"Record",
"timestamp.field":"local_timestamp",
"path.format":"YYYY-MM-dd-HH",
"partition.duration.ms":"3600000",
"schema.compatibility":"NONE"
}
}
数据是二进制的,我使用 avro 方案。我想使用实际的记录字段“local_timestamp”,它是一个 UNIX 时间戳来分区数据,比如每小时文件。
我使用通常的 REST API 调用启动连接器
curl -X POST -H "Content-Type: application/json" --data @s3-config.json http://localhost:8083/connectors
不幸的是,数据没有按照我的意愿进行分区。我还尝试删除冲洗尺寸,因为这可能会干扰。但是后来我得到了错误
{"error_code":400,"message":"Connector configuration is invalid and contains the following 1 error(s):\nMissing required configuration \"flush.size\" which has no default value.\nYou can also find the above list of errors at the endpoint `/{connectorType}/config/validate`"}%
知道如何正确设置 TimeBasedPartioner 吗?我找不到一个可行的例子。
另外,如何调试此类问题或进一步了解连接器实际在做什么?
非常感谢任何帮助或进一步的建议。
【问题讨论】:
标签: amazon-s3 apache-kafka apache-kafka-connect confluent-platform