背景:使用flink批作业 读取存在hdfs上的日志 需要迭代读取目录下所有文件的内容
使用的方法:
Configuration conf = new Configuration();
conf.setBoolean("recursive.file.enumeration", true);
DataSet<String> in = env.readTextFile(urlWithDate).withParameters(conf);
但是由于日志数量比较大 出现akka链接超时问题
无法正常提交job
相关社区issue:
https://issues.apache.org/jira/browse/FLINK-3964
后来改用如下方法读取日志,成功解决:
FileInputFormat fileInputFormat = new TextInputFormat(new Path(urlWithDate));
fileInputFormat.setnestedFileEnumeration(true);
DataSet<String> dataSet = env.readFile(fileInputFormat, urlWithDate);
相关mail-list参考:
http://mail-archives.apache.org/mod_mbox/flink-user/201701.mbox/<[email protected]>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。