【发布时间】:2012-02-09 05:41:49
【问题描述】:
我定义了自己的输入格式如下,以防止文件拆分:
import org.apache.hadoop.fs.*;
import org.apache.hadoop.mapred.TextInputFormat;
public class NSTextInputFormat extends TextInputFormat {
@Override
protected boolean isSplitable(FileSystem fs, Path file) {
return false;
}
}
我使用 Eclipse 将它编译成一个类 NSTextInputFormat.class。我将此类复制到启动作业的客户端。我使用以下命令启动作业并将上面的类作为输入格式传递。
hadoop jar $HADOOP_HOME/hadoop-streaming.jar -Dmapred.job.queue.name=unfunded -input 24222910/framefile -input 24225109/framefile -output Output -inputformat NSTextInputFormat -mapper ExtractHSV -file ExtractHSV -file NSTextInputFormat.class -numReduceTasks 0
这失败了: -inputformat:找不到类:NSTextInputFormat 流式传输作业失败!
我将 PATH 和 CLASSPATH 变量设置为包含 NSTextInputFormat.class 的目录,但这仍然不起作用。对此的任何指示都会有所帮助。
【问题讨论】: