【发布时间】:2015-05-20 06:15:34
【问题描述】:
public void run(Context context) throws IOException, InterruptedException
{
setup(context);
while (context.nextKeyValue()) {
map(context.getCurrentKey(), context.getCurrentValue(), context);
}
cleanup(context);
}
使用上面的sn-p,当mapper的run方法被调用时,每次通过nextkeyvalue()函数从recordreader获取下一个key,value对并处理当前key,value对。那么在这种情况下,如果我们正在处理特定 inputsplit 的最后一条记录,nextkeyvalue() 函数将返回 false,并且我们不会丢失每个 inputsplit 中的最后一条记录?
【问题讨论】:
标签: hadoop mapreduce recordreader