今天继续hadoop后续学习
FileInputFormat 切片源码解析
默认情况下,切片大小=blocksize,
文件大小大于block(块)的1.1倍(SPLIT_SLOP)才会分成两个任务
切片原理按照每一个文件单独切片
设置切片大小
extInputFormat是一个文件一个分片
默认分片是TextInputFormat
如果想要改动
在Driver中添加
// 如果不设置 InputFormat,它默认用的是
TextInputFormat.class job.setInputFormatClass(CombineTextInputFormat.class);
//虚拟存储切片最大值设置 4m
CombineTextInputFormat.setMaxInputSplitSize(job, 4194304);
这个最大值可以自己修改 改成20 100 128等
学习时间:13:19到 16:01