hadoop 性能优化

来源:互联网 发布:测帧数软件 编辑:程序博客网 时间:2024/06/11 09:06

1:对于有很多小文件的时候,hadoop默认使用TextInputFormat处理文件,所以会有很多maptask
处理措施:
1:在前端处理的时候先将小文件合并,再传入hadoop
2:如果已经是小文件在hdfs中了,可以使用combineInputFormat
进行小文件合并

job.setInputFormatClass(CombineTextInputFormat.class)CombineTextInputFormat.
0 0