本文主要是介绍疑问 : hadoop API 中 旧版 OutputFormat 是接口, 而新版 API 的 OutputFormat 是抽象类,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
仁者见仁,智者见智
请各位大侠不吝赐教
1.旧版 API 的 OutputFormat
public interface OutputFormat<K, V> {RecordWriter<K, V> getRecordWriter(FileSystem arg0, JobConf arg1, String arg2, Progressable arg3) throws IOException;void checkOutputSpecs(FileSystem arg0, JobConf arg1) throws IOException;
}
2.新版API 的 OutputFormat
public abstract class OutputFormat<K, V> {public abstract RecordWriter<K, V> getRecordWriter(TaskAttemptContext arg0) throws IOException, InterruptedException;public abstract void checkOutputSpecs(JobContext arg0) throws IOException, InterruptedException;public abstract OutputCommitter getOutputCommitter(TaskAttemptContext arg0) throws IOException, InterruptedException;
}
接口是对行为的封装,抽象是对事物的封装
个人认为,旧版本的API 可能不是十分恰当
consult :
https://blog.csdn.net/u010159842/article/details/71083650
https://www.cnblogs.com/wuyudong/p/4348704.html
这篇关于疑问 : hadoop API 中 旧版 OutputFormat 是接口, 而新版 API 的 OutputFormat 是抽象类的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!