0
我刚开始学习hadoop。下面提到的是我的java代码连接到hadoop hdfs。Hadoop dfs java客户端不能正常工作
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(conf);
BufferedReader reader = new BufferedReader(new InputStreamReader(fs.open(new Path("hdfs://localhost:54310"))));
String line = null;
line = reader.readLine();
while(line!=null){
System.out.println(line);
line = reader.readLine();
}
reader.close();
fs.close();
我收到错误消息,指出hdfs:// localhost:54310不是有效的文件名。