问题描述
我必须使用Snappy来压缩地图o / p和map-reduce o / p。
I have to use Snappy to compress the map o/p and the map-reduce o/p as well. Further, this should be splittable.
当我在网上学习时,为了使Snappy编写可拆分的o / p,我们必须在Container类型的格式中使用它。
As I studied online, to make Snappy write splittable o/p, we have to use it in a Container like format.
你能建议怎么去吗?我试图在网上找到一些例子,但不能罚款。我使用Hadoop v0.20.203。
Can you please suggest how to go about it? I tried finding some examples online, but could not fine one. I am using Hadoop v0.20.203.
谢谢。
Piyush
Thanks.Piyush
推荐答案
输出
conf.setOutputFormat(SequenceFileOutputFormat.class);
SequenceFileOutputFormat.setOutputCompressionType(conf,CompressionType.BLOCK);
SequenceFileOutputFormat.setCompressOutput(conf,true);
conf.set(mapred.output.compression.codec,org.apache.hadoop.io.compress.SnappyCodec);
地图输出
配置conf = new Configuration();
conf.setBoolean(mapred.compress.map.output,true);
conf.set(mapred.map.output.compression.codec,org.apache.hadoop.io.compress.SnappyCodec);
这篇关于如何在容器格式的Hadoop中使用Snappy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!