TextInputFormat源码
来源:互联网 发布:手机怎么注册淘宝号 编辑:程序博客网 时间:2024/05/16 00:33
TextInputFormat是FileInputFormat的子类,其createRecordReader()方法返回的就是LineRecordReader。
- public
class <</span>LongWritable,TextInputFormat extends FileInputFormat Text >{ -
-
@Override -
public RecordReader<</span>LongWritable, Text > -
createRecordReader(InputSplit split, -
TaskAttemptContext context) { -
return new LineRecordReader(); -
} -
-
@Override -
protected boolean isSplitable(JobContext context, Path file) { -
CompressionCodec codec = -
new CompressionCodecFactory(context.getConfiguration()).getCodec(file); -
return codec == null; -
} - }
我们还看到isSplitable()方法,当文件使用压缩的形式,这个文件就不可分割,否则就读取不到正确的数据了。这从某种程度上将影响分片的计算。 有时我们希望一个文件只被一个Mapper处理的时候,我们就可以重写isSplitable()方法,告诉MapReduce框架,我哪些文件可以分 割,哪些文件不能分割而只能作为一个分片。
0 0
- TextInputFormat源码
- Hadoop TextInputFormat源码分析
- 旧版API的TextInputFormat源码分析
- hadoop中的TextInputFormat类源码分析
- Hadoop源码解析之: TextInputFormat如何处理跨split的行
- Hadoop源码解析之: TextInputFormat如何处理跨split的行
- Hadoop源码解析之: TextInputFormat如何处理跨split的行
- MR-2.输入格式(InputFormat)TextInputFormat和SequenceFileInputFormat源码分析
- Hadoop源码解析之: TextInputFormat如何处理跨split的行
- Hadoop源码解析之: TextInputFormat如何处理跨split的行
- SequenceFileInputFormat区别TextInputFormat
- hive-TextInputformat自定义分隔符
- MapReduce程序开发中的FileInputFormat与TextInputFormat
- Hadoop源代码分析(一)——输入(TextInputFormat,FileSplit,LineRecordReader)
- 由TextInputFormat编译错误到Hadoop.mapred包和Hadoop.mapreduce包的区别
- 源码
- 源码
- 源码
- JAR规格和使用清单
- 输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数
- hdu 1558
- Tomacat配置
- onWindowFocusChanged重要作用
- TextInputFormat源码
- mysql 中COMMANDS 支持的所有命令
- ORACLE PL/SQL编程详解之七:程序包的创建与应用
- dao contentValues与对象抽取
- LOG4J.PROPERTIES配置详解
- LeetCode | Minimum Path Sum
- 乱序存储和顺序存储(堆组织表和索引组织表(IOT))
- Java Collection中List和Set的区别
- 统计素数