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