Hadoop中新老版本MapReduce 中API对比
来源:互联网 发布:java程序调用存储过程 编辑:程序博客网 时间:2024/06/05 07:59
新老版本MapReduce 中InputFormat、OutputFormat,Job API 对比,以JobBuilder函数为例:
package tools;import java.io.IOException;import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; //新版本import org.apache.hadoop.mapreduce.Job;import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;/** * 老版本//import org.apache.hadoop.mapred.FileInputFormat; //import org.apache.hadoop.mapred.FileOutputFormat; //import org.apache.hadoop.mapred.JobConf; */import org.apache.hadoop.util.Tool; public class JobBuilder { /**老版本 public static JobConf parseInputAndOutput(Tool tool, Configuration conf, String[] args) { if (args.length != 2) { printUsage(tool, "<input><output>"); return null; } JobConf jobConf = new JobConf(conf, tool.getClass()); FileInputFormat.addInputPath(jobConf, new Path(args[0])); FileOutputFormat.setOutputPath(jobConf, new Path(args[1])); return jobConf; } */ public static Job parseInputAndOutput(Tool tool,Configuration conf, String[] args) throws IOException{ if (args.length != 2) { printUsage(tool, "<input><output>"); return null; } Job job=new Job(conf); job.setJarByClass(tool.getClass()); FileInputFormat.addInputPath(job, new Path(args[0])); FileOutputFormat.setOutputPath(job, new Path(args[1])); return job; } public static void printUsage(Tool tool, String extraArgsUsage) { System.err.printf("Usage:%s [genericOptions] %s\n\n", tool.getClass() .getSimpleName(), extraArgsUsage); } }
0 0
- Hadoop中新老版本MapReduce 中API对比
- Hadoop新旧API对比初探+链式mapreduce
- hadoop MapReduce基本框架对比
- Hadoop 新旧API对比
- hadoop版本的对比
- hadoop版本的对比
- hadoop 版本功能对比
- HADOOP 0.20.2以上版本MapReduce中采用压缩技术
- Hadoop MapReduce新旧API区别
- Hadoop 新旧MapReduce API比较
- Hadoop读书笔记(七)MapReduce 0.x版本API使用demo
- hadoop mapreduce中压缩
- Spark与Hadoop MapReduce的对比分析
- hadoop 新API与旧API对比
- 【Hadoop】新旧Java MapReduce API的差异
- hadoop 1.0.4 版本mapreduce 单元测试
- Hadoop 版本 生态圈 MapReduce模型
- hadoop中mapreduce属性设置
- Spring bean 的生命周期的详解
- bnuoj 1028 软件安装
- 几种方式实现Javaweb页面跳转
- 运算符优先级口诀,偶然间看到的 分享
- Tomcat源码阅读之过滤器
- Hadoop中新老版本MapReduce 中API对比
- Dialog的2种常用样式
- 【Linux系统编程】进程同步与互斥:POSIX有名信号量
- java之简单工厂设计模式
- ThinkPHP框架中简化URL地址
- 队列的优先级处理的思路
- 正则表达式-网页爬虫-从服务器或本地文件获取邮件地址
- Android实战之驱家新闻app(六)完
- Android4.4后短信机制的变化