hadoop利用Gzip压缩文件
来源:互联网 发布:淘宝转卖闲鱼怎么发货 编辑:程序博客网 时间:2024/06/15 15:06
As described in the introduction section, if the input files are compressed, they will be decompressed automatically as they are read by MapReduce, using the filename extension to determine which codec to use. This is input compression.
Here we list some code for setting up output compression in Hadoop for some common compression formats.
Here we list some code for setting up output compression in Hadoop for some common compression formats.
Gzip
For final output, we can use the static convenience methos on FileOutputFormat to set the properties.
FileOutputFormat.setCompressOutput(job, true);
FileOutputFormat.setOutputCompressorClass(job, GzipCodec,class);
For map output
Configuration conf = new Configuration();
conf.setBoolean("mapred.compress.map.output",true);
conf.setClass("mapred.map.output.compression.codec", GzipCodec.class, CompressionCodec.class);
Job job=new Job(conf);
For final output, we can use the static convenience methos on FileOutputFormat to set the properties.
FileOutputFormat.setCompressOutput(job, true);
FileOutputFormat.setOutputCompressorClass(job, GzipCodec,class);
For map output
Configuration conf = new Configuration();
conf.setBoolean("mapred.compress.map.output",true);
conf.setClass("mapred.map.output.compression.codec", GzipCodec.class, CompressionCodec.class);
Job job=new Job(conf);
MapReduce中对Map的输出进行压缩,2句设置:
conf.setCompressionMapOutput(true);
conf.setMapOutputCompressorClass(GzipCodec.class)
0 0
- hadoop利用Gzip压缩文件
- 利用.net2.0中的GZip或Deflate压缩文件
- 利用.net2.0中的GZip或Deflate压缩文件
- 利用.net2.0中的GZip或Deflate压缩文件
- gzip, zcat 压缩文件
- gzip循环压缩文件
- python gzip压缩文件
- 压缩文件gzip zcat
- hadoop压缩文件
- .NET GZip压缩和解压缩文件
- 用Python创建gzip压缩文件
- Android Gzip压缩和解压缩文件
- 在Python下使用gzip压缩文件
- 用GZIP压缩文件和解压文件
- php gzip压缩文件的基本读写
- web使用GZIP压缩和解压缩文件
- java Gzip方式 解压,压缩文件Utils
- golang基础(golang压缩文件gzip)
- 一种处理同一个I2C总线上,器件地址冲突的方法
- MATLAB Curve Fitting Toolbox拟合结果统计数据的含义
- SVN服务器搭建和使用(3)
- android user版本如何打开root权限
- mahout个性化推荐的一些帖子
- hadoop利用Gzip压缩文件
- hibernate的current_session_context_class配置
- android 如何添加第3方lib库到kernel中
- C语言文件操作函数大全
- 听说此文又是一篇找砖头的文章, 善良,可爱型的人请速速离开。 1: 模板引擎。 模板引擎是否得继续使用及发挥作用, 成为phper们在争论的第一话题。 其实我们可以换个立场来思考, 如果d
- mysql中的select * for update
- 卸载MySQL,安装SQLite
- Spanned
- java解析xml的方法