原文地址: https://blog.csdn.net/qq_31807385/article/details/84315821
InputFormat的作用:
切片
把切片打散成< K ,V >
主要分为下面这几种不同的数据输入的方式:
FileInputFormat | 按照文件的块大小进行切片 | 该类没有实现 |
TextInputFormat | 按照文件的块大小进行切片 | LineLineRecordReader,key是偏移量,value是一行的内容 |
KeyValueInputFormat | 按照文件的块大小进行切片 | KeyValueLineRecordReader,key是第一列,value是剩余的内容 |
NLineInputFormat | 按照行进行切片 | LineRecordReader,key是偏移量,value是一行的 内容 |
CombineTextInputFormat | 按照设置的最大值进行切片 | CombineFileRecordReader,keyl是偏移量,value是一行的内容 |
自定义InputFormat | 按照文件的块大小进行切片 | 自定义RecordReader,Text和LongWritable |
TextInputFormat | https://blog.csdn.net/qq_31807385/article/details/84332570 |
KeyValueInputFormat | https://blog.csdn.net/qq_31807385/article/details/84331532 |
NLineInputFormat | https://blog.csdn.net/qq_31807385/article/details/84314122 |
CombineTextInputFormat | https://blog.csdn.net/qq_31807385/article/details/84329389 |
自定义InputFormat | https://blog.csdn.net/qq_31807385/article/details/84316050 |
OutPutFormat: