Hadoop Pipes

时间:2023-03-10 04:51:26
Hadoop Pipes

Hadoop Pipes

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

  Hadoop Pipes

 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.

  Hadoop Pipes

  Hadoop Pipes