hadoop超时解决办法

进行矩阵计算的时候,由于持续时间长,往往会出现超时的错误,错误内容如下:

Task attempt_201005281116_119912_r_000823_0 failed to report status for 606 seconds. Killing!
10/06/10 10:49:45 INFO mapred.JobClient: Task Id : attempt_201005281116_119912_r_000015_1, Status : FAILED

解决办法是在代码中定时report

        final TaskAttemptContext context = 
   
    ;
        long lastTime = System.currentTimeMillis();

        public void ping() {
            final long currtime = System.currentTimeMillis();
            
    if (currtime - lastTime > 10000) {
                context.progress();
                lastTime = currtime;
            }
        }
   

你可能感兴趣的:(hadoop,report,2010)