Mapper类中的成员方法及对象
IntWritable类:
public class IntWritable
extends Object
implements WritableComparable
是WritableComparable接口的实现类并继承了object类,此类的有参构造方法为IntWritable(int value)。
Text类:
set方法其中的一种重载形式:
set(String string)
Set to contain the contents of a string.
map方法:
在写Mapper的继承类时,要重写Mapper类里的map方法,其中有一个Context参数,Mapper.Context类里的构造方法为:
public Mapper.Context(Configuration conf,
TaskAttemptID taskid,
RecordReader<KEYIN,VALUEIN> reader,
RecordWriter<KEYOUT,VALUEOUT> writer,
OutputCommitter committer,
StatusReporter reporter,
InputSplit split)
throws IOException,
InterruptedException
其中的RecordReader参数用来获取输入信息&#x