org.apache.hadoop.mapred.Task - Failure committing: java.io.IOException: Could not rename

多个文件输出时报错:
06:20:30,429 [pool-3-thread-1] WARN org.apache.hadoop.fs.FileUtil - Failed to delete file or dir [F:\projects\output_temporary\0_temporary\attempt_local722729032_0001_r_000000_0.data-r-00000.crc]: it still exists.
06:20:30,430 [pool-3-thread-1] WARN org.apache.hadoop.fs.FileUtil - Failed to delete file or dir [F:\projects\output_temporary\0_temporary\attempt_local722729032_0001_r_000000_0.data0-r-00000.crc]: it still exists.
06:20:30,431 [pool-3-thread-1] WARN org.apache.hadoop.fs.FileUtil - Failed to delete file or dir [F:\projects\output_temporary\0_temporary\attempt_local722729032_0001_r_000000_0.data1-r-00000.crc]: it still exists.
06:20:30,433 [pool-3-thread-1] WARN org.apache.hadoop.fs.FileUtil - Failed to delete file or dir [F:\projects\output_temporary\0_temporary\attempt_local722729032_0001_r_000000_0\data-r-00000]: it still exists.
06:20:30,434 [pool-3-thread-1] WARN org.apache.hadoop.fs.FileUtil - Failed to delete file or dir [F:\projects\output_temporary\0_temporary\attempt_local722729032_0001_r_000000_0\data0-r-00000]: it still exists.
06:20:30,435 [pool-3-thread-1] WARN org.apache.hadoop.fs.FileUtil - Failed to delete file or dir [F:\projects\output_temporary\0_temporary\attempt_local722729032_0001_r_000000_0\data1-r-00000]: it still exists.
06:20:30,436 [pool-3-thread-1] WARN org.apache.hadoop.mapred.Task - Failure committing: java.io.IOException: Could not rename file:/F:/projects/output/_temporary/0/_temporary/attempt_local722729032_0001_r_000000_0 to file:/F:/projects/output/_temporary/0/task_local722729032_0001_r_000000
解决方案:
在reduce阶段重写cleanup方法,将其关闭

// 关闭资源
@Override
protected void cleanup(Context context) throws IOException, InterruptedException {
multipleOutputs.close();
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值