Hadoop自定义InputForma类,无法将其作为setnputormat的参数,请各位帮忙看看什么问题???
想写一个自定义的InputFormat类
ImageFileInputormat类从继承Filenputormat<Text, Text>,这个类很简单,只需要得到输入路径下的文件名同时作为键和值。但是在conf.setInputFormat(ImageFileInputFormat.class),编译的时候出现一下错误:
ImageDemo.java:121: error: method setInputFormat in class JobConf cannot be applied to given types;
conf.setInputFormat(ImageFileInputFormat.class);
^
required: Class<? extends InputFormat>
found: Class<ImageFileInputFormat>
reason: actual argument Class<ImageFileInputFormat> cannot be converted to Class<? extends InputFormat> by method invocation conversion
1 error
请各位帮帮忙?看看我出现了什么问题,不胜感激!