【发布时间】:2014-01-27 17:36:17
【问题描述】:
我在 Hadoop 中有一个类 ImageInputFormat,它从 HDFS 读取图像。如何在 Spark 中使用我的 InputFormat?
这是我的ImageInputFormat:
public class ImageInputFormat extends FileInputFormat<Text, ImageWritable> {
@Override
public ImageRecordReader createRecordReader(InputSplit split,
TaskAttemptContext context) throws IOException, InterruptedException {
return new ImageRecordReader();
}
@Override
protected boolean isSplitable(JobContext context, Path filename) {
return false;
}
}
【问题讨论】:
标签: hadoop hdfs apache-spark