apacheFlume+hdfsFlume

1sbrub3j  于 2021-06-04  发布在  Flume
关注(0)|答案(1)|浏览(370)

我们能为hdfs接收器添加一个分隔符吗?当写入is文件时,如何添加记录分隔符?
配置如下:-

tier1.sinks.hdfssink.type = hdfs
 tier1.sinks.hdfssink.channel = memory
 tier1.sinks.hdfssink.hdfs.path=tmp/kafka/%{topic}/%y-%m-%d
 tier1.sinks.hdfssink.hdfs.rollSize=268435456
 tier1.sinks.hdfssink.hdfs.rollCount=0
 tier1.sinks.hdfssink.hdfs.rollInterval = 0
 tier1.sinks.hdfssink.hdfs.useLocalTimeStamp=true
 tier1.sinks.hdfssink.hdfs.fileType=DataStream
 tier1.sinks.hdfssink.hdfs.inUseSuffix=.tmp
 tier1.sinks.hdfssink.hdfs.batchSize=10000
2q5ifsrm

2q5ifsrm1#

我倾向于使用flume eventserializer,其配置与此类似:

tier1.sinks.hdfssink.serializer = <your serialization class>
tier1.sinks.hdfssink.serializer.delimiter = < your delimiter>

有关详细信息和代码段,您可以参考以下github站点。
https://github.com/relistan/flume-serializers
希望这对你有帮助!

相关问题