Tekkaman

导航

 

Hadoop Pipes

 1、MapContext的getInputSplit()可以用于获取当前mapper所对象的文件路经,也就是Pipes中,没有InputSplit接口/对象。

  

 2、在Pipes中,不需要也没法自实现InputFormat及InputSplit。我们所能做的只有,实现一个RecordReader(用以把自己定义文件数据转换成为Key&value),需要在构造函数中根据MapContext获取文件名(路径),然后打开读取,并实现RecordReader接口。

  注意:

  1)TextInputFormat is the default InputFormat.

  2)FileSplit is the default InputSplit. It sets map.input.file to the path of the input file for the logical split.

  

  

posted on 2013-10-07 23:51  Tekkaman  阅读(545)  评论(0编辑  收藏  举报