您的位置:首页 > 其它

Tez控制输出的文件是否压缩并指定文件名

2015-08-31 14:08 281 查看
在如下的代码后:

TezConfiguration tezConf;
if (conf != null) {
tezConf = new TezConfiguration(conf);
} else {
tezConf = new TezConfiguration();
}




加入:

/**
* decide outputfile whether to be compress;
*/
tezConf.setBoolean(FileOutputFormat.COMPRESS,
tezConf.getBoolean("isCompress", false));

/**
* decide outputfile name;
*/
tezConf.set("mapreduce.output.basename",
tezConf.get("fileName", "Tez.log"));


更精确的控制,可以参看“org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<K, V>“类。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: