Exception in thread "main" java.io.FileNotFoundException: Path is not a file: /LinearReg/output
我将FileSystem hdfs=FileSystem.get(conf);
替换成
Path output_path=new Path(args[5]);
System.out.println("output_path="+args[5]);
FileSystem hdfs=output_path.getFileSystem(conf);
Float[] theta=new Float[num_features];
BufferedReader br1 = new BufferedReader(new InputStreamReader(hdfs.open(output_path)));
还是出现错误,错误输出如下:
output_path=hdfs://localhost:9000/LinearReg/output
log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" java.io.FileNotFoundException: Path is not a file: /LinearReg/output