Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法报告状态达600秒。谋杀!报告hadoop的进展_Java_Hadoop_Mapreduce - Fatal编程技术网

Java 无法报告状态达600秒。谋杀!报告hadoop的进展

Java 无法报告状态达600秒。谋杀!报告hadoop的进展,java,hadoop,mapreduce,Java,Hadoop,Mapreduce,我收到以下错误: Task attempt_201304161625_0028_m_000000_0 failed to report status for 600 seconds. Killing! 我的地图工作。这个问题类似于,和。但是,我不希望在hadoop终止不报告进度的任务之前增加默认时间,即 Configuration conf=new Configuration(); long milliSeconds = 1000*60*60; conf.setLong("mapred.ta

我收到以下错误:

Task attempt_201304161625_0028_m_000000_0 failed to report status for 600 seconds. Killing! 
我的地图工作。这个问题类似于,和。但是,我不希望在hadoop终止不报告进度的任务之前增加默认时间,即

Configuration conf=new Configuration();
long milliSeconds = 1000*60*60;
conf.setLong("mapred.task.timeout", milliSeconds);
相反,我希望使用
context.progress()
context.setStatus(“某些消息”)
context.getCounter(Some_ENUM.progress).increment(1)
或类似方法定期报告进度。但是,这仍然会导致作业被终止。下面是我试图报告进度的代码片段。制图员:

protected void map(Key key, Value value, Context context) throws IOException, InterruptedException {

    //do some things
    Optimiser optimiser = new Optimiser();
    optimiser.optimiseFurther(<some parameters>, context);
    //more things
    context.write(newKey, newValue);
}

但是,在默认的时间量之后,仍将终止作业。我是否以错误的方式使用了上下文?为了成功报告进度,在作业设置中是否还需要执行其他操作

可能发生的情况是,您必须在报告器本身上调用那些在上下文中找到的进度方法,而这些方法可能无法在上下文本身上调用

来自Cloudera

报告进度

如果您的任务在10分钟内没有报告任何进展(请参阅mapred.task.timeout属性),那么它将被Hadoop杀死。大多数任务不会遇到这种情况,因为它们通过读取输入和写入输出隐式地报告进度。但是,某些不以这种方式处理记录的作业可能会违反此行为,并导致其任务被终止。模拟是一个很好的例子,因为它们在每个映射中都进行大量CPU密集型处理,并且通常只在计算结束时写入结果。它们的书写方式应确保定期报告进度(频率高于每10分钟一次)。这可以通过多种方式实现:

Call setStatus() on Reporter to set a human-readable description of
the task’s progress
Call incrCounter() on Reporter to increment a user counter
Call progress() on Reporter to tell Hadoop that your task is 
still there (and making progress)

公共上下文(配置配置配置、TaskAttempId、taskid、,
录像机阅读器,
唱片作者,
输出提交人提交人,
记者:,
输入拆分(拆分)

此问题与对
context.setStatus()
context.progress()
的调用没有报告给底层框架有关(对设置各种计数器的调用也不起作用)。有一个补丁可用,因此更新到更新版本的Hadoop应该可以解决这个问题。

谢谢您的帮助!我已经从Cloudera读过了。但是,我正在使用新的API,它使用
上下文
对象而不是旧的
报告器
对象。
Optimise Progress:Progressing:0
Optimise Progress:Progressing:1
Optimise Progress:Progressing:2
...
Call setStatus() on Reporter to set a human-readable description of
the task’s progress
Call incrCounter() on Reporter to increment a user counter
Call progress() on Reporter to tell Hadoop that your task is 
still there (and making progress)
public Context(Configuration conf, TaskAttemptID taskid,
               RecordReader<KEYIN,VALUEIN> reader,
               RecordWriter<KEYOUT,VALUEOUT> writer,
               OutputCommitter committer,
               StatusReporter reporter,
               InputSplit split)