仁者见仁,智者见智
请各位大侠不吝赐教
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 :