这个原因很多,可能是源码的问题。下面列出可能的原因:
1.源码:
错误源码
[mw_shl_code=java,true] int result = job.waitForCompletion(true) ? 0 : 1;
System.out.println(new String[] { outputPath });
DistributedLzoIndexer.main(new String[] { outputPath });
System.exit(result);
return 0;[/mw_shl_code]
正确源码
[mw_shl_code=java,true]int result = job.waitForCompletion(true) ? 0 : 1;
DistributedLzoIndexer lzoIndexer = new DistributedLzoIndexer();
Configuration indexConf = new Configuration();
indexConf.set("io.compression.codecs","com.hadoop.compression.lzo.LzopCodec");
lzoIndexer.setConf(indexConf);
lzoIndexer.run(new String[] { outputPath });
System.exit(result);
return 0;[/mw_shl_code]
2.是否设置
(1)配置文件中修改configuration中有没有io.compression.codecs这个参数
(2)源码修改
程序中添加如下内容试试
[mw_shl_code=xml,true]conf.set("io.compression.codecs", "org.apache.hadoop.io.compress.DefaultCodec,org.apache.hadoop.io.compress.GzipCodec,com.hadoop.compression.lzo.LzopCodec");
conf.set("io.compression.codec.lzo.class", "com.hadoop.compression.lzo.LzoCodec"); [/mw_shl_code]
上面只是列出可能原因,楼主可以排查下,希望有所帮助
|